@Test
public void sendsTxStartedEventBefore() throws Exception {

  int timeout = new Random().nextInt();
  int forwardRetries = new Random().nextInt();
  int forwardTimeout = new Random().nextInt();
  int reverseRetries = new Random().nextInt();
  int reverseTimeout = new Random().nextInt();
  int retryDelayInMilliseconds = new Random().nextInt();
  interceptor.preIntercept(parentTxId, compensationMethod, timeout, retryMethod, forwardRetries,
      forwardTimeout, reverseRetries, reverseTimeout, retryDelayInMilliseconds, message);
  TxEvent event = messages.get(0);
  assertThat(event.globalTxId(), is(globalTxId));
  assertThat(event.localTxId(), is(localTxId));
  assertThat(event.parentTxId(), is(parentTxId));
  assertThat(event.forwardRetries(), is(forwardRetries));
  assertThat(event.forwardTimeout(), is(forwardTimeout));
  assertThat(event.reverseRetries(), is(reverseRetries));
  assertThat(event.reverseTimeout(), is(reverseTimeout));
  assertThat(event.timeout(), is(timeout));
  assertThat(event.retryDelayInMilliseconds(), is(retryDelayInMilliseconds));
  assertThat(event.retryMethod(), is(retryMethod));
  assertThat(event.type(), is(EventType.TxStartedEvent));
  assertThat(event.compensationMethod(), is(compensationMethod));
  assertThat(asList(event.payloads()).contains(message), is(true));
}