MongoQueryBuilderFactory implements QueryBuilderFactory { @Override public QueryBuilder newBuilder(final Criteria criteria) { checkCriteria(criteria); return MongoQueryBuilder.limited(criteria, limitsConfig.getThingsSearchMaxPageSize(), limitsConfig.getThingsSearchDefaultPageSize()); } MongoQueryBuilderFactory(final LimitsConfig limitsConfig); @Override QueryBuilder newBuilder(final Criteria criteria); @Override QueryBuilder newUnlimitedBuilder(final Criteria criteria);  }
@Test public void newBuilderWithValidCriteria() { final QueryBuilder builder = underTest.newBuilder(mock(Criteria.class)); assertThat(builder).isInstanceOf(MongoQueryBuilder.class); }
@Test(expected = NullPointerException.class) public void newBuilderWithNullCriteria() { underTest.newBuilder(null); }