Package org.junit.jupiter.api


package org.junit.jupiter.api
JUnit Jupiter API for writing tests.
  • Class
    Description
    @AfterAll is used to signal that the annotated method should be executed after all tests in the current test class.
    @AfterEach is used to signal that the annotated method should be executed after each @Test, @RepeatedTest, @ParameterizedTest, @TestFactory, and @TestTemplate method in the current test class.
    AssertAll is a collection of utility methods that support asserting multiple conditions in tests at once.
    AssertArrayEquals is a collection of utility methods that support asserting array equality in tests.
    AssertDoesNotThrow is a collection of utility methods that support explicitly asserting that a given code block does not throw an exception.
    AssertEquals is a collection of utility methods that support asserting equality on objects and primitives in tests.
    AssertFalse is a collection of utility methods that support asserting false in tests.
    Assertions is a collection of utility methods that support asserting conditions in tests.
    AssertionUtils is a collection of utility methods that are common to all assertion implementations.
    AssertIterable is a collection of utility methods that support asserting Iterable equality in tests.
    AssertLinesMatch is a collection of utility methods that support asserting lines of String equality or Pattern-match in tests.
     
    AssertNotEquals is a collection of utility methods that support asserting inequality in objects and primitive values in tests.
    AssertNotNull is a collection of utility methods that support asserting that there is an object.
    AssertNotSame is a collection of utility methods that support asserting two objects are not the same.
    AssertNull is a collection of utility methods that support asserting there is no object.
    AssertSame is a collection of utility methods that support asserting two objects are the same.
    AssertThrows is a collection of utility methods that support asserting an exception of an expected type is thrown.
    AssertTimeout is a collection of utility methods that support asserting the execution of the code under test did not take longer than the timeout duration.
     
    The thread factory used for preemptive timeout.
    AssertTrue is a collection of utility methods that support asserting true in tests.
    Assumptions is a collection of utility methods that support conditional test execution based on assumptions.
    @BeforeAll is used to signal that the annotated method should be executed before all tests in the current test class.
    @BeforeEach is used to signal that the annotated method should be executed before each @Test, @RepeatedTest, @ParameterizedTest, @TestFactory, and @TestTemplate method in the current test class.
    @Disabled is used to signal that the annotated test class or test method is currently disabled and should not be executed.
    @DisplayName is used to declare a custom display name for the annotated test class or test method.
    @DisplayNameGeneration is used to declare a custom display name generator for the annotated test class.
    DisplayNameGenerator defines the SPI for generating display names programmatically.
    DisplayNameGenerator that generates complete sentences.
    DisplayNameGenerator that replaces underscores with spaces.
    Simple DisplayNameGenerator that removes trailing parentheses for methods with no parameters.
    Standard DisplayNameGenerator.
    A DynamicContainer is a container generated at runtime.
    DynamicNode serves as the abstract base class for a container or a test case generated at runtime.
    A DynamicTest is a test case generated at runtime.
    @IndicativeSentencesGeneration is used to declare a custom parameters by IndicativeSentences, if this notation has some not declared parameters, it will use the default values instead.
    MethodDescriptor encapsulates functionality for a given Method.
    MethodOrderer defines the API for ordering the test methods in a given test class.
    Deprecated.
    Please use MethodOrderer.MethodName instead.
    MethodOrderer that sorts methods alphanumerically based on their display names using String.compareTo(String)
    MethodOrderer that sorts methods alphanumerically based on their names using String.compareTo(String).
    MethodOrderer that sorts methods based on the @Order annotation.
    MethodOrderer that orders methods pseudo-randomly.
    MethodOrdererContext encapsulates the context in which a MethodOrderer will be invoked.
    @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.
    @Order is an annotation that is used to configure the order in which the annotated element (i.e., field or method) should be evaluated or executed relative to other elements of the same category.
    @RepeatedTest is 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.
    RepetitionInfo is used to inject information about the current repetition of a repeated test into @RepeatedTest, @BeforeEach, and @AfterEach methods.
    @Tag is a repeatable annotation that is used to declare a tag for the annotated test class or test method.
    @Tags is a container for one or more @Tag declarations.
    @Test is used to signal that the annotated method is a test method.
    @TestFactory is used to signal that the annotated method is a test factory method.
    TestInfo is used to inject information about the current test or container into to @Test, @RepeatedTest, @ParameterizedTest, @TestFactory, @BeforeEach, @AfterEach, @BeforeAll, and @AfterAll methods.
    @TestInstance is 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.
    @TestMethodOrder is a type-level annotation that is used to configure a MethodOrderer for the test methods of the annotated test class or test interface.
    Parameters of type TestReporter can be injected into @BeforeEach and @AfterEach lifecycle methods as well as methods annotated with @Test, @RepeatedTest, @ParameterizedTest, @TestFactory, etc.
    @TestTemplate is used to signal that the annotated method is a test template method.
    @Timeout is used to define a timeout for a method or all testable methods within one class and its @Nested classes.