@Test public void sendsSagaStartedEvent() { sagaStartAnnotationProcessor.preIntercept(null, null, 0, null, 0); TxEvent event = messages.get(0); assertThat(event.globalTxId(), is(globalTxId)); assertThat(event.localTxId(), is(globalTxId)); assertThat(event.parentTxId(), is(nullValue())); assertThat(event.compensationMethod().isEmpty(), is(true)); assertThat(event.type(), is(EventType.SagaStartedEvent)); assertThat(event.payloads().length, is(0)); }
@Override public AlphaResponse preIntercept(String parentTxId, String compensationMethod, int timeout, String retriesMethod, int retries, Object... message) { try { return sender.send(new SagaStartedEvent(omegaContext.globalTxId(), omegaContext.localTxId(), timeout, omegaContext.category())); } catch (OmegaException e) { throw new TransactionalException(e.getMessage(), e.getCause()); } }
SagaStartAnnotationProcessor implements EventAwareInterceptor { @Override public AlphaResponse preIntercept(String parentTxId, String compensationMethod, int timeout, String retriesMethod, int retries, Object... message) { try { return sender.send(new SagaStartedEvent(omegaContext.globalTxId(), omegaContext.localTxId(), timeout, omegaContext.category())); } catch (OmegaException e) { throw new TransactionalException(e.getMessage(), e.getCause()); } } }
SagaStartAnnotationProcessor implements EventAwareInterceptor { @Override public AlphaResponse preIntercept(String parentTxId, String compensationMethod, int timeout, String retriesMethod, int retries, Object... message) { try { return sender.send(new SagaStartedEvent(omegaContext.globalTxId(), omegaContext.localTxId(), timeout, omegaContext.category())); } catch (OmegaException e) { throw new TransactionalException(e.getMessage(), e.getCause()); } } SagaStartAnnotationProcessor(OmegaContext omegaContext, MessageSender sender); }
SagaStartAnnotationProcessor implements EventAwareInterceptor { @Override public AlphaResponse preIntercept(String parentTxId, String compensationMethod, int timeout, String retriesMethod, int retries, Object... message) { try { return sender.send(new SagaStartedEvent(omegaContext.globalTxId(), omegaContext.localTxId(), timeout, omegaContext.category())); } catch (OmegaException e) { throw new TransactionalException(e.getMessage(), e.getCause()); } } SagaStartAnnotationProcessor(OmegaContext omegaContext, MessageSender sender); @Override AlphaResponse preIntercept(String parentTxId, String compensationMethod, int timeout, String retriesMethod,
      int retries, Object... message); @Override void postIntercept(String parentTxId, String compensationMethod); @Override void onError(String parentTxId, String compensationMethod, Throwable throwable); }
SagaStartAnnotationProcessor implements EventAwareInterceptor { @Override public AlphaResponse preIntercept(String parentTxId, String compensationMethod, int timeout, String retriesMethod, int retries, Object... message) { try { return sender.send(new SagaStartedEvent(omegaContext.globalTxId(), omegaContext.localTxId(), timeout, omegaContext.category())); } catch (OmegaException e) { throw new TransactionalException(e.getMessage(), e.getCause()); } } SagaStartAnnotationProcessor(OmegaContext omegaContext, MessageSender sender); @Override AlphaResponse preIntercept(String parentTxId, String compensationMethod, int timeout, String retriesMethod,
      int retries, Object... message); @Override void postIntercept(String parentTxId, String compensationMethod); @Override void onError(String parentTxId, String compensationMethod, Throwable throwable);  }