use of io.zeebe.client.event.GeneralEvent in project zeebe by zeebe-io.
the class RecordingEventHandler method assertTaskEvent.
public void assertTaskEvent(int index, long taskKey, String eventType) throws IOException {
final List<GeneralEvent> taskEvents = events.stream().filter(e -> e.getMetadata().getType() == TopicEventType.TASK).collect(Collectors.toList());
final GeneralEvent taskEvent = taskEvents.get(index);
final EventMetadata eventMetadata = taskEvent.getMetadata();
assertThat(eventMetadata.getType()).isEqualTo(TopicEventType.TASK);
assertThat(eventMetadata.getKey()).isEqualTo(taskKey);
final JsonNode event = objectMapper.readTree(taskEvent.getJson());
assertThat(event.get("state").asText()).isEqualTo(eventType);
}
Aggregations