Module org.junit.jupiter.api
Package org.junit.jupiter.api
package org.junit.jupiter.api
JUnit Jupiter API for writing tests.
-
ClassDescription
@AfterAllis used to signal that the annotated method should be executed after all tests in the current test class.@AfterEachis used to signal that the annotated method should be executed after each@Test,@RepeatedTest,@ParameterizedTest,@TestFactory, and@TestTemplatemethod in the current test class.Builder forAssertionFailedErrors.Assertionsis a collection of utility methods that support asserting conditions in tests.Assertions.TimeoutFailureFactory<T extends Throwable>Factory for timeout failures.Assumptionsis a collection of utility methods that support conditional test execution based on assumptions.@AutoCloseis used to indicate that an annotated field will be automatically closed after test execution.@BeforeAllis used to signal that the annotated method should be executed before all tests in the current test class.@BeforeEachis used to signal that the annotated method should be executed before each@Test,@RepeatedTest,@ParameterizedTest,@TestFactory, and@TestTemplatemethod in the current test class.ClassDescriptorencapsulates functionality for a givenClass.ClassOrdererdefines the API for ordering top-level test classes and@Nestedtest classes.ClassOrdererthat sorts classes alphanumerically based on their fully qualified names usingString.compareTo(String).ClassOrdererthat sorts classes alphanumerically based on their display names usingString.compareTo(String)ClassOrdererthat sorts classes based on the@Orderannotation.ClassOrdererthat orders classes pseudo-randomly.ClassOrdererContextencapsulates the context in which aClassOrdererwill be invoked.@Disabledis used to signal that the annotated test class or test method is currently disabled and should not be executed.@DisplayNameis used to declare a custom display name for the annotated test class or test method.@DisplayNameGenerationis used to declare a custom display name generator for the annotated test class.DisplayNameGeneratordefines the SPI for generating display names programmatically.DisplayNameGeneratorthat generates complete sentences.DisplayNameGeneratorthat replaces underscores with spaces.SimpleDisplayNameGeneratorthat removes trailing parentheses for methods with no parameters.StandardDisplayNameGenerator.ADynamicContaineris a container generated at runtime.DynamicNodeserves as the abstract base class for a container or a test case generated at runtime.ADynamicTestis a test case generated at runtime.@IndicativeSentencesGenerationis used to register theDisplayNameGenerator.IndicativeSentencesdisplay name generator and configure it.MethodDescriptorencapsulates functionality for a givenMethod.MethodOrdererdefines the API for ordering the test methods in a given test class.Deprecated.MethodOrdererthat sorts methods alphanumerically based on their display names usingString.compareTo(String)MethodOrdererthat sorts methods alphanumerically based on their names usingString.compareTo(String).MethodOrdererthat sorts methods based on the@Orderannotation.MethodOrdererthat orders methods pseudo-randomly.MethodOrdererContextencapsulates the context in which aMethodOrdererwill be invoked.Named<T>Namedis a container that associates a name with a given payload.NamedExecutablejoinsExecutableandNamedin a one self-typed functional interface.@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.@Orderis an annotation that is used to configure the order in which the annotated element (i.e., field, method, or class) should be evaluated or executed relative to other elements of the same category.@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 and an optional failure threshold.RepetitionInfois used to inject information about the current repetition of a repeated test into@RepeatedTest,@BeforeEach, and@AfterEachmethods.@Tagis a repeatable annotation that is used to declare a tag for the annotated test class or test method.@Tagsis a container for one or more@Tagdeclarations.@Testis used to signal that the annotated method is a test method.@TestClassOrderis a type-level annotation that is used to configure aClassOrdererfor the@Nestedtest classes of the annotated test class.@TestFactoryis used to signal that the annotated method is a test factory method.TestInfois used to inject information about the current test or container into to@Test,@RepeatedTest,@ParameterizedTest,@TestFactory,@BeforeEach,@AfterEach,@BeforeAll, and@AfterAllmethods.@TestInstanceis a type-level annotation that is used to configure the lifecycle of test instances for the annotated test class or test interface.Enumeration of test instance lifecycle modes.@TestMethodOrderis a type-level annotation that is used to configure aMethodOrdererfor the test methods of the annotated test class or test interface.Parameters of typeTestReportercan be injected into@BeforeEachand@AfterEachlifecycle methods as well as methods annotated with@Test,@RepeatedTest,@ParameterizedTest,@TestFactory, etc.@TestTemplateis used to signal that the annotated method is a test template method.@Timeoutis used to define a timeout for a method or all testable methods within one class and its@Nestedclasses.ThreadModeis used to define whether test code should be executed in the thread of the calling code or in a separate thread.
MethodOrderer.MethodName; to be removed in 6.0