@Test
public void timeoutTriggered_callbackAdded_callbackTriggered() {

    // given
    int delayInSec = 5;
    Object expectedData = new Object();
    Date expectedTimeoutIn = new Date(clock.now().getTime() + TimeUnit.SECONDS.toMillis(delayInSec));
    TimeoutExpired expiredCallback = mock(TimeoutExpired.class);
    sut.addExpiredCallback(expiredCallback);
    Timeout expected = Timeout.create(UUIDTimeoutId.generateNewId(), "theSagaId", "theTimeoutName", expectedTimeoutIn, expectedData);
    // when
    requestAndTriggerTimeout(expected.getSagaId(), expected.getName(), delayInSec, TimeUnit.SECONDS, expectedData);
    // then
    ArgumentCaptor<Timeout> captor = ArgumentCaptor.forClass(Timeout.class);
    verify(expiredCallback).expired(captor.capture());
    assertThat("Saga id does not match.", captor.getValue().getSagaId(), equalTo(expected.getSagaId()));
    assertThat("Timeout name does not match.", captor.getValue().getName(), equalTo(expected.getName()));
    assertThat("Expiration time stamp does not match.", captor.getValue().getExpiredAt(), equalTo(expected.getExpiredAt()));
    assertThat("Data object does not match.", captor.getValue().getData(), sameInstance(expectedData));
}