Package org.junit.jupiter.api
JUnit Jupiter API for writing tests.
-
Interface Summary Interface Description RepetitionInfo RepetitionInfois used to inject information about the current repetition of a repeated test into@RepeatedTest,@BeforeEach, and@AfterEachmethods.TestInfo TestInfois used to inject information about the current test or container into to@Test,@RepeatedTest,@ParameterizedTest,@TestFactory,@BeforeEach,@AfterEach,@BeforeAll, and@AfterAllmethods.TestReporter Parameters of typeTestReportercan be injected into@BeforeEachand@AfterEachlifecycle methods as well as methods annotated with@Test,@RepeatedTest,@ParameterizedTest,@TestFactory, etc. -
Class Summary Class Description Assertions Assertionsis a collection of utility methods that support asserting conditions in tests.Assumptions Assumptionsis a collection of utility methods that support conditional test execution based on assumptions.DynamicContainer ADynamicContaineris a container generated at runtime.DynamicNode DynamicNodeserves as the abstract base class for a container or a test case generated at runtime.DynamicTest ADynamicTestis a test case generated at runtime. -
Enum Summary Enum Description TestInstance.Lifecycle Enumeration of test instance lifecycle modes. -
Annotation Types Summary Annotation Type Description AfterAll @AfterAllis used to signal that the annotated method should be executed after all tests in the current test class.AfterEach @AfterEachis used to signal that the annotated method should be executed after each@Test,@RepeatedTest,@ParameterizedTest,@TestFactory, and@TestTemplatemethod in the current test class.BeforeAll @BeforeAllis used to signal that the annotated method should be executed before all tests in the current test class.BeforeEach @BeforeEachis used to signal that the annotated method should be executed before each@Test,@RepeatedTest,@ParameterizedTest,@TestFactory, and@TestTemplatemethod in the current test class.Disabled @Disabledis used to signal that the annotated test class or test method is currently disabled and should not be executed.DisplayName @DisplayNameis used to declare a custom display name for the annotated test class or test method.Nested @Nestedis 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.RepeatedTest @RepeatedTestis used to signal that the annotated method is a test template method that should be repeated a specified number of times with a configurable display name.Tag @Tagis a repeatable annotation that is used to declare a tag for the annotated test class or test method.Tags @Tagsis a container for one or more@Tagdeclarations.Test @Testis used to signal that the annotated method is a test method.TestFactory @TestFactoryis used to signal that the annotated method is a test factory method.TestInstance @TestInstanceis a type-level annotation that is used to configure the lifecycle of test instances for the annotated test class or test interface.TestTemplate @TestTemplateis used to signal that the annotated method is a test template method.