@Test
public void onEvent_testWithString() throws Exception {

  Event event = new Cancel();
  String raw = mapper.writeValueAsString(event);
  doReturn(event).when(encoder).decode(raw);
  underTest.onEvent(raw);
  assertThat(underTest.getEvents().peek(), is(event));
}