@Test public void doNothingInNonTransactionRequest() throws Exception { when(invocation.getContext()).thenReturn(Collections.EMPTY_MAP); handler.handle(invocation, asyncResponse); assertThat(omegaContext.globalTxId(), is(nullValue())); assertThat(omegaContext.localTxId(), is(nullValue())); }
@Override public void handle(Invocation invocation, AsyncResponse asyncResponse) throws Exception { if (omegaContext != null) { String globalTxId = invocation.getContext().get(GLOBAL_TX_ID_KEY); if (globalTxId == null) { LOG.debug("no such header: {}", GLOBAL_TX_ID_KEY); } else { omegaContext.setGlobalTxId(globalTxId); omegaContext.setLocalTxId(invocation.getContext().get(LOCAL_TX_ID_KEY)); } } else { LOG.info("Cannot inject transaction ID, as the OmegaContext is null or cannot get the globalTxId."); } invocation.next(asyncResponse); }
SagaProviderHandler implements Handler { @Override public void handle(Invocation invocation, AsyncResponse asyncResponse) throws Exception { if (omegaContext != null) { String globalTxId = invocation.getContext().get(GLOBAL_TX_ID_KEY); if (globalTxId == null) { LOG.debug("no such header: {}", GLOBAL_TX_ID_KEY); } else { omegaContext.setGlobalTxId(globalTxId); omegaContext.setLocalTxId(invocation.getContext().get(LOCAL_TX_ID_KEY)); } } else { LOG.info("Cannot inject transaction ID, as the OmegaContext is null or cannot get the globalTxId."); } invocation.next(asyncResponse); } }
SagaProviderHandler implements Handler { @Override public void handle(Invocation invocation, AsyncResponse asyncResponse) throws Exception { if (omegaContext != null) { String globalTxId = invocation.getContext().get(GLOBAL_TX_ID_KEY); if (globalTxId == null) { LOG.debug("no such header: {}", GLOBAL_TX_ID_KEY); } else { omegaContext.setGlobalTxId(globalTxId); omegaContext.setLocalTxId(invocation.getContext().get(LOCAL_TX_ID_KEY)); } } else { LOG.info("Cannot inject transaction ID, as the OmegaContext is null or cannot get the globalTxId."); } invocation.next(asyncResponse); } SagaProviderHandler();  SagaProviderHandler(OmegaContext omegaContext); }
SagaProviderHandler implements Handler { @Override public void handle(Invocation invocation, AsyncResponse asyncResponse) throws Exception { if (omegaContext != null) { String globalTxId = invocation.getContext().get(GLOBAL_TX_ID_KEY); if (globalTxId == null) { LOG.debug("no such header: {}", GLOBAL_TX_ID_KEY); } else { omegaContext.setGlobalTxId(globalTxId); omegaContext.setLocalTxId(invocation.getContext().get(LOCAL_TX_ID_KEY)); } } else { LOG.info("Cannot inject transaction ID, as the OmegaContext is null or cannot get the globalTxId."); } invocation.next(asyncResponse); } SagaProviderHandler();  SagaProviderHandler(OmegaContext omegaContext); @Override void handle(Invocation invocation, AsyncResponse asyncResponse); }
SagaProviderHandler implements Handler { @Override public void handle(Invocation invocation, AsyncResponse asyncResponse) throws Exception { if (omegaContext != null) { String globalTxId = invocation.getContext().get(GLOBAL_TX_ID_KEY); if (globalTxId == null) { LOG.debug("no such header: {}", GLOBAL_TX_ID_KEY); } else { omegaContext.setGlobalTxId(globalTxId); omegaContext.setLocalTxId(invocation.getContext().get(LOCAL_TX_ID_KEY)); } } else { LOG.info("Cannot inject transaction ID, as the OmegaContext is null or cannot get the globalTxId."); } invocation.next(asyncResponse); } SagaProviderHandler();  SagaProviderHandler(OmegaContext omegaContext); @Override void handle(Invocation invocation, AsyncResponse asyncResponse);  }