@ -53,11 +53,9 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@RunWith ( SpringJUnit4ClassRunner . class )
@RunWith ( SpringJUnit4ClassRunner . class )
public abstract class AbstractPersonRepositoryIntegrationTests {
public abstract class AbstractPersonRepositoryIntegrationTests {
@Autowired
@Autowired protected PersonRepository repository ;
protected PersonRepository repository ;
@Autowired
@Autowired MongoOperations operations ;
MongoOperations operations ;
Person dave , oliver , carter , boyd , stefan , leroi , alicia ;
Person dave , oliver , carter , boyd , stefan , leroi , alicia ;
QPerson person ;
QPerson person ;
@ -570,4 +568,26 @@ public abstract class AbstractPersonRepositoryIntegrationTests {
public void executesAnnotatedCountProjection ( ) {
public void executesAnnotatedCountProjection ( ) {
assertThat ( repository . someCountQuery ( "Matthews" ) , is ( 2L ) ) ;
assertThat ( repository . someCountQuery ( "Matthews" ) , is ( 2L ) ) ;
}
}
/ * *
* @see DATAMONGO - 701
* /
@Test
public void executesDerivedStartsWithQueryCorrectly ( ) {
List < Person > result = repository . findByLastnameStartsWith ( "Matt" ) ;
assertThat ( result , hasSize ( 2 ) ) ;
assertThat ( result , hasItems ( dave , oliver ) ) ;
}
/ * *
* @see DATAMONGO - 701
* /
@Test
public void executesDerivedEndsWithQueryCorrectly ( ) {
List < Person > result = repository . findByLastnameEndsWith ( "thews" ) ;
assertThat ( result , hasSize ( 2 ) ) ;
assertThat ( result , hasItems ( dave , oliver ) ) ;
}
}
}