@Test public void testWithMultipleFieldPivot() throws Exception { SolrQueryMethod method = getQueryMethodByName("findByNamePivotOnField1VsField2AndField2VsField3"); Assert.assertFalse(method.hasAnnotatedQuery()); Assert.assertFalse(method.hasProjectionFields()); Assert.assertFalse(method.hasFacetFields()); Assert.assertTrue(method.hasPivotFields()); Assert.assertFalse(method.hasFacetQueries()); Assert.assertEquals(2, method.getPivotFields().size()); Assert.assertFalse(method.hasAnnotatedNamedQueryName()); Assert.assertFalse(method.hasFilterQuery()); }
@Test public void testWithSingleFieldPivot() throws Exception { SolrQueryMethod method = getQueryMethodByName("findByNamePivotOnField1VsField2"); Assert.assertFalse(method.hasAnnotatedQuery()); Assert.assertFalse(method.hasProjectionFields()); Assert.assertFalse(method.hasAnnotatedNamedQueryName()); Assert.assertFalse(method.hasFacetFields()); Assert.assertTrue(method.hasPivotFields()); Assert.assertFalse(method.hasFacetQueries()); Assert.assertFalse(method.hasFilterQuery()); Assert.assertEquals(1, method.getPivotFields().size()); Assert.assertEquals(Integer.valueOf(10), method.getFacetLimit()); Assert.assertEquals(Integer.valueOf(1), method.getFacetMinCount()); }
@Test public void testWithMultipleFieldPivotsLimitAndMinCount() throws Exception { SolrQueryMethod method = getQueryMethodByName("findByNamePivotOnField1VsField2AndField2VsField3AndLimitAndMinCount"); Assert.assertFalse(method.hasAnnotatedQuery()); Assert.assertFalse(method.hasProjectionFields()); Assert.assertFalse(method.hasFacetFields()); Assert.assertTrue(method.hasPivotFields()); Assert.assertFalse(method.hasFacetQueries()); Assert.assertFalse(method.hasAnnotatedNamedQueryName()); Assert.assertFalse(method.hasFilterQuery()); Assert.assertEquals(2, method.getPivotFields().size()); Assert.assertEquals(Integer.valueOf(25), method.getFacetLimit()); Assert.assertEquals(Integer.valueOf(3), method.getFacetMinCount()); }