The @DefaultLocale and @DefaultTimeZone annotations can be used to change the values returned from Locale.getDefault() and TimeZone.getDefault(), respectively, which are often used implicitly when no specific locale or time zone is chosen. Both annotations work on the test class level and on the test method level, and are inherited from higher-level containers. After the annotated element has been executed, the initial default value is restored.

Warning

These extensions were contributed to the JUnit Framework and are available since JUnit version 6.1.0. Therefore, they were removed from JUnit Pioneer.