Mocking the return value of System.currentTimeMillis() with JMockit

  • July 20, 2016

Having the ability to mock the return value of System.currentTimeMillis() can be very useful when testing time-sensitive code. The following is an example of how to accomplish the mocking of System.currentTimeMillis() to return any desired value, easily with JMockit 1.25.

Read More