I am writing tests for an HTTP REST-like API. These tests are end-to-end tests, communicating with running entire application (web server, database, everything).
I am looking for a good way to test time based features. Since it is end-to-end test, I cannot simply mock time related functions.
As an example think about the google calendar.
Scenario: Event notification
Given it is 15:09
When I create new event starting at 15:20 with email notification 10 minutes in advance
Then I receive email notification within next 3 minutes
I was thinking about sending header that would (in dev environment) change application time, but the worker that sends notifications run in separate process and would not be affected.
Aucun commentaire:
Enregistrer un commentaire