use of com.thoughtworks.gocd.elasticagent.ecs.events.Event in project gocd-ecs-elastic-agent by gocd.
the class PluginStatusReportViewTest method assertEventStreamView.
private void assertEventStreamView(String view, String type, List<Event> events) {
final Document document = Jsoup.parse(view);
final Elements errorHeaders = document.select(format(".event-stream .%s.event .event-header", type));
final Elements errorDescriptions = document.select(format(".event-stream .%s.event .event-description", type));
assertThat(errorHeaders).hasSameSizeAs(errorDescriptions).hasSameSizeAs(events);
IntStream.range(0, events.size()).forEach(index -> {
Event error = events.get(index);
assertThat(errorHeaders.get(index).text()).isEqualTo(error.getMessage());
assertThat(errorDescriptions.get(index).text()).isEqualTo(error.getDescription());
});
}