use of com.thinkbiganalytics.rest.model.search.SearchResult in project kylo by Teradata.
the class ModelUtils method toSearchResult.
/**
* Convert a spring-data Page to a SearchResult UI object
*/
public static SearchResult toSearchResult(Page page) {
SearchResult searchResult = new SearchResultImpl();
searchResult.setData(page.getContent());
searchResult.setRecordsTotal(page.getTotalElements());
searchResult.setRecordsFiltered(page.getTotalElements());
return searchResult;
}
use of com.thinkbiganalytics.rest.model.search.SearchResult in project kylo by Teradata.
the class IntegrationTestBase method getFeeds.
protected FeedSummary[] getFeeds() {
final ObjectMapper mapper = new ObjectMapper();
SearchResult<Object> searchResult = getFeedsExpectingStatus(HTTP_OK).as(SearchResultImpl.class);
return searchResult.getData().stream().map(o -> mapper.convertValue(o, FeedSummary.class)).toArray(FeedSummary[]::new);
}
use of com.thinkbiganalytics.rest.model.search.SearchResult in project kylo by Teradata.
the class FeedModelTransform method toSearchResult.
/**
* Convert a spring-data Page to a SearchResult UI object
*/
public SearchResult toSearchResult(Page<UIFeed> page) {
SearchResult searchResult = new SearchResultImpl();
searchResult.setData(page.getContent());
searchResult.setRecordsTotal(page.getTotalElements());
searchResult.setRecordsFiltered(page.getTotalElements());
return searchResult;
}
use of com.thinkbiganalytics.rest.model.search.SearchResult in project kylo by Teradata.
the class IntegrationTestBase method getServiceLevelAssessments.
protected ServiceLevelAssessment[] getServiceLevelAssessments(String filter) {
LOG.info(String.format("Getting up to 50 SLA Assessments for filter %s", filter));
Response response = given(ServiceLevelAssessmentsController.BASE).urlEncodingEnabled(// url encoding enabled false to avoid replacing percent symbols in url query part
false).when().get("?filter=" + filter + "&limit=50&sort=-createdTime&start=0");
response.then().statusCode(HTTP_OK);
SearchResult<Object> result = response.as(SearchResultImpl.class);
final ObjectMapper mapper = new ObjectMapper();
return result.getData().stream().map(o -> mapper.convertValue(o, ServiceLevelAssessment.class)).toArray(ServiceLevelAssessment[]::new);
}
Aggregations