@Test
public void sendsCompensatedEventOnCompensationCompleted() {

  final CallbackContext context = mock(CallbackContext.class);
  final CompensationMessageHandler handler = new CompensationMessageHandler(sender, context);
  IdGenerator<String> idGenerator = new UniqueIdGenerator();
  OmegaContext omegaContext = new OmegaContext(idGenerator,AlphaMetas.builder().akkaEnabled(false).build());
  when(context.getOmegaContext()).thenReturn(omegaContext);
  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, parentTxId, compensationMethod, payload);
}