@Test public void testQueryWithEmptyHighlight() throws Exception { SolrQueryMethod method = getQueryMethodByName("findByTextLike", String.class); Assert.assertTrue(method.isHighlightQuery()); Assert.assertNull(method.getHighlightFormatter()); Assert.assertNull(method.getHighlightQuery()); Assert.assertNull(method.getHighlighSnipplets()); Assert.assertThat(method.getHighlightFieldNames(), IsEmptyCollection.empty()); Assert.assertNull(method.getHighlightFragsize()); Assert.assertNull(method.getHighlightPrefix()); Assert.assertNull(method.getHighlightPostfix()); }
@Test public void testQueryWithNegativeHighlightSnipplets() throws Exception { SolrQueryMethod method = getQueryMethodByName("findByTextNegativeHighlightSnipplets", String.class); Assert.assertNull(method.getHighlighSnipplets()); }
@Test public void testQueryWithHighlightSnipplets() throws Exception { SolrQueryMethod method = getQueryMethodByName("findByTextHighlightSnipplets", String.class); Assert.assertEquals(Integer.valueOf(2), method.getHighlighSnipplets()); }