@Test
public void sendEvent() throws Exception {

  Event event = new Message<>(0, 1L, 2, 3L, mapper.createObjectNode());
  String raw = "";
  doReturn(raw).when(underTest).encodeEvent(event);
  underTest.sendEvent(event);
  ArgumentCaptor<Runnable> senderCaptor = ArgumentCaptor.forClass(Runnable.class);
  verify(metrics).record(eq(SEND), senderCaptor.capture());
  senderCaptor.getValue().run();
  verify(sender).send(raw);
}