use of org.apache.metron.indexing.dao.search.SearchResponse in project metron by apache.
the class SearchIntegrationTest method results_are_paginated.
@Test
public void results_are_paginated() throws Exception {
SearchRequest request = JSONUtils.INSTANCE.load(paginationQuery, SearchRequest.class);
SearchResponse response = dao.search(request);
Assert.assertEquals(10, response.getTotal());
List<SearchResult> results = response.getResults();
Assert.assertEquals(3, results.size());
Assert.assertEquals("snort", results.get(0).getSource().get("source:type"));
Assert.assertEquals(6, results.get(0).getSource().get("timestamp"));
Assert.assertEquals("bro", results.get(1).getSource().get("source:type"));
Assert.assertEquals(5, results.get(1).getSource().get("timestamp"));
Assert.assertEquals("bro", results.get(2).getSource().get("source:type"));
Assert.assertEquals(4, results.get(2).getSource().get("timestamp"));
}
Aggregations