Top Description Methods
org.junit.jupiter.api

public @Interface Nested

extends Annotation
Annotations
@Target:TYPE
@Retention:RUNTIME
@Documented
@API
status:STABLE
since:5.0
Static Imports
org.apiguardian.api.API.Status.STABLE

@Nested is used to signal that the annotated class is a nested, non-static test class (i.e., an inner class) that can share setup and state with an instance of its enclosing class. The enclosing class may be a top-level test class or another @Nested test class, and nesting can be arbitrarily deep.

@Nested test classes may be ordered via @TestClassOrder or a global ClassOrderer.

Test Instance Lifecycle

Since
5.0
See Also
Test, TestInstance, TestClassOrder

Method Summary

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString