Annotation Type TimeMachine

  • @Documented
    public @interface TimeMachine
    For time specific tests you can use this annotation to set the todays date.
    1.6 (06.09.2015)
    $Revision: 1.3 $
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String today
      You need a specific day for your unit test?
    • Element Detail

      • today

        java.lang.String today
        You need a specific day for your unit test? Use this annotation together with the TimeMachineAspect, to set it. Each call of the normal Date constructur will create a Date with this day as the current date.

        The format of the date is "dd-MMM-yyyy" or "dd-MMM-yyyy H:mm".

        NOTE: For a successful work of the TimeMachineAspect ony methods which are not called via reflexion work as expected. Because JUnit tests are called via reflexion extract your test method in an extra method "subTestMethod" and mark this "subTestMethod" with "@TimeMachine".

        the string