Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow a user to test timer and timeouts features without waiting for the real world time #13

Open
4 of 7 tasks
anthonime opened this issue Jan 30, 2017 · 0 comments
Open
4 of 7 tasks

Comments

@anthonime
Copy link
Contributor

anthonime commented Jan 30, 2017

Business workflows may be expressed in terms of hours, days, weeks or months.
Doing integration tests in thoses conditions are impossible.
We must provide a way to allow a library user to configuer Swiffer to transform durations to a unit testable time scale.

Each duration passed to Swiffer should be transformed internally using a DurationTransformer before being passed to SWF.
This include:

  • start timer decision timeout
  • schedule activity type decision timeouts
  • workflow type timeouts
  • activity type timeouts
  • schedule children workflow decision timeouts
  • schedule lambda decision timeouts
  • continue as new workflow decision timeouts

Expected interface:

public interface DurationTransformer {
 java.time.Duration transform(Duration requestedDuration);
}

Default implementation is a noop: it just return the request duration.
Another implementation is provided: TestingDurationTransformer with public methods and convenient to use:
public void setDurationOfADay(Duration dayDuration);

The implementation should be provided only during construction of the Swiffer instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant