Java, tests different services without modifying the business code and system time

< H2 > Code directly < / H2 >
   

but it is found that neither SystemFactory nor SystemClock knows who it is.

Mar.17,2021

if you want to test different times, why write the time dead in the business method. You can raise the time to the parameters:

  

Clock of java8, system is injected during normal operation, and fixed

is injected during testing.
Menu