You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@BeforeEach and @AfterEach aren't executed around each dynamic test. They are executed only once per @TestFactory. I would expect that they are reliably run around each dynamic test.
I tested on both IntelliJ 2020.1.3 and Maven 3.6.1. What's baffling is that the results are different on each platform.
On IntelliJ, with the snippet below, I get the following output:
before
after
Hello
World
On Maven, I get the following output:
before
Hello
World
after
I would expect that @BeforeEach and @AfterEach are executed around each test, dynamic or not:
Well, thank you GitHub, I searched for the same issue before creating this one but couldn't find using my search terms. At least Google helped, only after I created this issue. It can be closed as a duplicate of #378.
There seems to be bugs in org.junit.jupiter.api.BeforeEach of JUnit 5 at this moment.
It cannot guarantee the annotated method being excuted before each test method.
References:
- junit-team/junit5#2360
- junit-team/junit5#378
@BeforeEach
and@AfterEach
aren't executed around each dynamic test. They are executed only once per@TestFactory
. I would expect that they are reliably run around each dynamic test.I tested on both IntelliJ 2020.1.3 and Maven 3.6.1. What's baffling is that the results are different on each platform.
On IntelliJ, with the snippet below, I get the following output:
On Maven, I get the following output:
I would expect that
@BeforeEach
and@AfterEach
are executed around each test, dynamic or not:Steps to reproduce
Context
The text was updated successfully, but these errors were encountered: