use of org.apache.metron.indexing.dao.update.Document in project metron by apache.
the class SearchIntegrationTest method get_all_latest_guid.
@Test
public void get_all_latest_guid() throws Exception {
List<GetRequest> request = JSONUtils.INSTANCE.load(getAllLatestQuery, new JSONUtils.ReferenceSupplier<List<GetRequest>>() {
});
Map<String, Document> docs = new HashMap<>();
for (Document doc : dao.getAllLatest(request)) {
docs.put(doc.getGuid(), doc);
}
Assert.assertEquals(2, docs.size());
Assert.assertTrue(docs.keySet().contains("bro_1"));
Assert.assertTrue(docs.keySet().contains("snort_2"));
Assert.assertEquals("bro", docs.get("bro_1").getDocument().get("source:type"));
Assert.assertEquals("snort", docs.get("snort_2").getDocument().get("source:type"));
}
Aggregations