### Question:
CompensationMessageHandler implements MessageHandler { @Override public void onReceive(String globalTxId, String localTxId, String parentTxId, String compensationMethod, Object... payloads) { try { context.apply(globalTxId, localTxId, compensationMethod, payloads); } catch (Exception e) { LOG.error("Failed to execute 'onReceive.context.apply' localTxId {}", localTxId, e); } } CompensationMessageHandler(MessageSender sender, CompensationContext context); @Override void onReceive(String globalTxId, String localTxId, String parentTxId, String compensationMethod,
      Object... payloads);  }### Answer:
@Test public void sendsCompensatedEventOnCompensationCompleted() { handler.onReceive(globalTxId, localTxId, parentTxId, compensationMethod, payload); assertThat(events.size(), is(1)); TxEvent event = events.get(0); assertThat(event.globalTxId(), is(globalTxId)); assertThat(event.localTxId(), is(localTxId)); assertThat(event.parentTxId(), is(parentTxId)); assertThat(event.type(), is(EventType.TxCompensatedEvent)); assertThat(event.compensationMethod(), is(getClass().getCanonicalName())); assertThat(event.payloads().length, is(0)); verify(context).apply(globalTxId, localTxId, compensationMethod, payload); }