We have a component which works based on the current date in following manner (kind of recurring manner).
- pick something eligible for today.
- do some processing on it (this again involves code having logic on current date).
- update parameters for next round (i.e. when it should be picked and other dates).
So basically there are multiple services doing different things, and depends on current date.
Now we want to write integration test cases for this whole component. In order to do that we create one object (lets assume it will have 4 rounds before it hit the end of road).
So can you please help us how should we go about it?
- have a different service for current date, and use it everywhere in the whole system. Mock it/ initialize with the required date while doing integration testing.
- some other suggestion.
Thanks