Search in sources :

Example 1 with PartTreeMongoQuery

use of org.springframework.data.mongodb.repository.query.PartTreeMongoQuery in project spring-data-mongodb by spring-projects.

the class IndexEnsuringQueryCreationListenerUnitTests method skipsQueryCreationForMethodWithoutPredicate.

// DATAMONGO-1753
@Test
public void skipsQueryCreationForMethodWithoutPredicate() {
    PartTree tree = mock(PartTree.class);
    when(tree.hasPredicate()).thenReturn(false);
    PartTreeMongoQuery query = mock(PartTreeMongoQuery.class, Answers.RETURNS_MOCKS);
    when(query.getTree()).thenReturn(tree);
    listener.onCreation(query);
    verify(provider, times(0)).indexOps(any());
}
Also used : PartTreeMongoQuery(org.springframework.data.mongodb.repository.query.PartTreeMongoQuery) PartTree(org.springframework.data.repository.query.parser.PartTree) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 PartTreeMongoQuery (org.springframework.data.mongodb.repository.query.PartTreeMongoQuery)1 PartTree (org.springframework.data.repository.query.parser.PartTree)1