-
@Retention(RUNTIME) @Target({METHOD,TYPE}) @Inherited @ExtendWith(FailAtExtension.class) public @interface FailAt@FailAtis a JUnit Jupiter extension to mark tests that shouldn't be executed after a given date, essentially failing a test when the date is reached. The date is given as an ISO 8601 string.It may optionally be declared with a reason to document why the annotated test class or test method should fail at the given date.
@FailAtcan be used on the method and class level. It can only be used once per method or class, but is inherited from higher-level containers.WARNING: This annotation allows the user to move an assumption out of one or multiple test method's code into an annotation. But this comes at a cost: Applying
@FailAtcan make the test suite non-reproducible. If a passing test is run again after the specified date, that build would fail. A report entry is issued for every test that does not fail until a certain date.- Since:
- 2.3.0
-
-
Required Element Summary
Required Elements Modifier and Type Required Element Description java.lang.StringdateThe date from which this annotated test class or test method should fail as an ISO 8601 string in the format yyyy-MM-dd, e.g.
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.StringreasonThe reason this annotated test class or test method should fail as soon as the given date is reached.
-