2

In our scheduler application, we are using quartz scheduler with Spring Boot scheduler which reads System.currentTimeMillis().

Spring boot version is 1.3.5.

We are able to test scenarios like weekly, monthly, yearly by creating cron expression w.r.t current date time. And we are trying to simulate some situation where we will change the current system time for future and simulate few scenarios.

I know quartz scheduler is well tested and no need to test how it will behave in future. Still, if someone has implemented/tested with similar approach, and can share knowledge it will be a great help.

aUserHimself
  • 1,589
  • 2
  • 17
  • 26
SUMIT
  • 540
  • 1
  • 4
  • 19
  • It's a native method, it receives time from the OS. Try chaning time on the test server/VM. – Ilya Novoseltsev May 11 '17 at 14:45
  • Thanks llya... But I want to automate my test....Do you know how to change OS time while starting up the my spring application? – SUMIT May 12 '17 at 04:39
  • Look at this article http://stackoverflow.com/questions/6203857/how-can-i-set-the-system-time-in-java - try the ClassLoader trick to set system time. – Ilya Novoseltsev May 12 '17 at 10:43

0 Answers0