Package org.junit.jupiter.api
Annotation Type AfterAll
-
@Target({ANNOTATION_TYPE,METHOD}) @Retention(RUNTIME) @Documented @API(status=STABLE, since="5.0") public @interface AfterAll
@AfterAllis used to signal that the annotated method should be executed after all tests in the current test class.In contrast to
@AfterEachmethods,@AfterAllmethods are only executed once for a given test class.Method Signatures
@AfterAllmethods must have avoidreturn type, must not beprivate, and must bestaticby default. Consequently,@AfterAllmethods are not supported in@Nestedtest classes or as interface default methods unless the test class is annotated with@TestInstance(Lifecycle.PER_CLASS).@AfterAllmethods may optionally declare parameters to be resolved byParameterResolvers.Inheritance
@AfterAllmethods are inherited from superclasses as long as they are not hidden or overridden. Furthermore,@AfterAllmethods from superclasses will be executed before@AfterAllmethods in subclasses.Composition
@AfterAllmay be used as a meta-annotation in order to create a custom composed annotation that inherits the semantics of@AfterAll.- Since:
- 5.0
- See Also:
BeforeAll,BeforeEach,AfterEach,Test,TestFactory,TestInstance