@Test
public void addEventExecution() {

	String messageId = "some-message-id";
	EventExecution eventExecution = new EventExecution();
	eventExecution.setId("some-id");
	eventExecution.setMessageId(messageId);
	eventExecution.setAction(Type.complete_task);
	eventExecution.setEvent("some-event");
	eventExecution.setStatus(EventExecution.Status.COMPLETED);
	indexDAO.addEventExecution(eventExecution);
	await()
		.atMost(5, TimeUnit.SECONDS)
		.untilAsserted(() -> {
               SearchResponse searchResponse = search(
                   LOG_INDEX_PREFIX + "*",
                   "messageId='" + messageId + "'",
                   0,
                   10000,
                   "*",
                   EVENT_DOC_TYPE
               );
			assertEquals("search results should be length 1", searchResponse.getHits().getTotalHits(), 1);
			SearchHit searchHit = searchResponse.getHits().getAt(0);
			GetResponse response = elasticSearchClient
				.prepareGet(searchHit.getIndex(), EVENT_DOC_TYPE, searchHit.getId())
				.get();
			assertEquals("indexed message id should match", messageId, response.getSource().get("messageId"));
			assertEquals("indexed id should match", "some-id", response.getSource().get("id"));
			assertEquals("indexed status should match", EventExecution.Status.COMPLETED.name(), response.getSource().get("status"));
		});
	List<EventExecution> events = indexDAO.getEventExecutions("some-event");
	assertEquals(1, events.size());
	assertEquals(eventExecution, events.get(0));
}