-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Based on JUnit5 user-guide extensions execution order should correlate with extensions declaration order:
Extensions registered declaratively via @ExtendWith will be executed in the order in which they are declared in the source code. For example, the execution of tests in both MyFirstTests and MySecondTests will be extended by the FooExtension and BarExtension, in exactly that order.
But it does not.
@ExtendWith({FirstExtension.class, SecondExtension.class})
Expected output
FirstExtension afterEach method call
SecondExtension afterEach method call
Actual output
SecondExtension afterEach method call
FirstExtension afterEach method call
Jupiter-api version is 5.3.1
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.3.1</version>
Deliverables
-
Document the lack of explicit ordering for all user-supplied callback methods (i.e.,
@BeforeEach
,@AfterEach
,@BeforeAll
,@AfterAll
) declared within a single test class/interface.- in Javadoc
- in User Guide
-
Document the lack of wrapping behavior for all user-supplied callback methods (e.g.,
@AfterAll
,@AfterEach
) declared within a single test class/interface.- in Javadoc
- in User Guide
-
Document wrapping behavior for all user-supplied callback methods (i.e.,
@BeforeEach
,@AfterEach
,@BeforeAll
,@AfterAll
) within test class/interface hierarchies.- in Javadoc
- in User Guide
-
Document wrapping behavior for all applicable extension APIs (e.g.,
TestExecutionExceptionHandler
,AfterTestExecutionCallback
,AfterEachCallback
,AfterAllCallback
, etc.).- in Javadoc
- in User Guide