@Test
public void setUpOmegaContextInTransactionRequest() throws Exception {

  Map<String, String> context = new HashMap<>();
  context.put(GLOBAL_TX_ID_KEY, globalTxId);
  context.put(LOCAL_TX_ID_KEY, localTxId);
  when(invocation.getContext()).thenReturn(context);
  doAnswer(new Answer<Void>() {
    // Just verify the context setting
    @Override
    public Void answer(InvocationOnMock invocation) throws Throwable {
      assertThat(omegaContext.globalTxId(), is(globalTxId));
      assertThat(omegaContext.localTxId(), is(localTxId));
      return null;
    }
  }).when(invocation).next(asyncResponse);
  handler.handle(invocation, asyncResponse);
  // Now the context should be clean
  assertThat(omegaContext.globalTxId(), is(nullValue()));
  assertThat(omegaContext.localTxId(), is(nullValue()));
}