use of com.thinkbiganalytics.search.rest.model.SearchResult in project kylo by Teradata.
the class SearchCategoryMetadataEsIT method verifySearchResultOnDescription1.
private void verifySearchResultOnDescription1(String term) {
Response response = given(SearchRestController.BASE).when().get("/?q=" + term);
response.then().statusCode(HTTP_OK);
SearchResult searchResult = response.as(SearchResult.class);
verifyCommonPortionOfSearchResultOnCategory(searchResult, new HashSet<>(Collections.singletonList("Description")));
String expectedHighlightSubstring = "<font style='font-weight:bold'>Kylo</font> <font style='font-weight:bold'>Category</font> <font style='font-weight:bold'>Created</font> By Search Properties (<font style='font-weight:bold'>Category</font>) ES Integration Test";
Assert.assertTrue(searchResult.getSearchResults().get(0).getHighlights().get(0).getValue().toString().contains(expectedHighlightSubstring));
}
use of com.thinkbiganalytics.search.rest.model.SearchResult in project kylo by Teradata.
the class SearchFeedMetadataEsIT method verifySearchResultOnUserProperties2.
private void verifySearchResultOnUserProperties2(String term) {
Response response = given(SearchRestController.BASE).when().get("/?q=" + term);
response.then().statusCode(HTTP_OK);
SearchResult searchResult = response.as(SearchResult.class);
Assert.assertEquals("0", searchResult.getTotalHits().toString());
}
use of com.thinkbiganalytics.search.rest.model.SearchResult in project kylo by Teradata.
the class SearchFeedMetadataEsIT method verifySearchResultOnDescription1.
private void verifySearchResultOnDescription1(String term) {
Response response = given(SearchRestController.BASE).when().get("/?q=" + term);
response.then().statusCode(HTTP_OK);
SearchResult searchResult = response.as(SearchResult.class);
Assert.assertEquals("1", searchResult.getTotalHits().toString());
Assert.assertEquals("Description", searchResult.getSearchResults().get(0).getHighlights().get(0).getKey());
Assert.assertEquals("Sample feed for property search - <font style='font-weight:bold'>Integration</font> <font style='font-weight:bold'>Test</font>", searchResult.getSearchResults().get(0).getHighlights().get(0).getValue());
}
use of com.thinkbiganalytics.search.rest.model.SearchResult in project kylo by Teradata.
the class SearchFeedMetadataEsIT method verifySearchResultOnDescription2.
private void verifySearchResultOnDescription2(String term) {
Response response = given(SearchRestController.BASE).when().get("/?q=" + term);
response.then().statusCode(HTTP_OK);
SearchResult searchResult = response.as(SearchResult.class);
Assert.assertEquals("0", searchResult.getTotalHits().toString());
}
use of com.thinkbiganalytics.search.rest.model.SearchResult in project kylo by Teradata.
the class SearchFeedMetadataEsIT method verifySearchResultOnTitle1.
private void verifySearchResultOnTitle1(String term) {
Response response = given(SearchRestController.BASE).when().get("/?q=" + term);
response.then().statusCode(HTTP_OK);
SearchResult searchResult = response.as(SearchResult.class);
Assert.assertEquals("1", searchResult.getTotalHits().toString());
Assert.assertEquals("Description", searchResult.getSearchResults().get(0).getHighlights().get(0).getKey());
Assert.assertEquals("Tags", searchResult.getSearchResults().get(0).getHighlights().get(1).getKey());
Assert.assertEquals("Title", searchResult.getSearchResults().get(0).getHighlights().get(2).getKey());
Assert.assertEquals("<font style='font-weight:bold'>Sample</font> <font style='font-weight:bold'>feed</font> <font style='font-weight:bold'>for</font> <font style='font-weight:bold'>property</font> <font style='font-weight:bold'>search</font> - Integration Test", searchResult.getSearchResults().get(0).getHighlights().get(0).getValue());
Assert.assertEquals("<font style='font-weight:bold'>search</font> global <font style='font-weight:bold'>search</font> properties", searchResult.getSearchResults().get(0).getHighlights().get(1).getValue());
Assert.assertEquals("<font style='font-weight:bold'>Sample</font>-<font style='font-weight:bold'>Feed</font>-<font style='font-weight:bold'>For</font>-<font style='font-weight:bold'>Property</font>-<font style='font-weight:bold'>Search</font>", searchResult.getSearchResults().get(0).getHighlights().get(2).getValue());
}
Aggregations