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());
}
Aggregations