@Test
public void errorTransitionDelayIsBetweenMinAndMaxDelay() {

  int maxDelay = 1_000_000;
  int minDelay = 1000;
  WorkflowSettings s = new WorkflowSettings.Builder().setMinErrorTransitionDelay(minDelay).setMaxErrorTransitionDelay(maxDelay).build();
  long prevDelay = 0;
  for(int retryCount = 0 ; retryCount < 100 ; retryCount++) {
    long delay  = s.getErrorTransitionActivation(retryCount).getMillis() - now.getMillis();
    assertThat(delay, greaterThanOrEqualTo((long)minDelay));
    assertThat(delay, lessThanOrEqualTo((long)maxDelay));
    assertThat(delay, greaterThanOrEqualTo(prevDelay));
    prevDelay = delay;
  }
}