-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed as not planned
Closed as not planned
Copy link
Description
I'm using junit-bom:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.11.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>And I have two simple classes:
@Suite
@SelectClasses(TestClass.class)
public class MySuite {
public static int x = 0;
@BeforeSuite
static void beforeSuite() {
x = 42;
System.out.println("before suite");
}
@AfterSuite
static void afterSuite() {
System.out.println("after suite");
}
}and
public class TestClass {
@Test
void test() {
System.out.println("testing : " + MySuite.x);
}
}If run MySuite from IntelliJ (latest version available: Build #IU-241.19072.14, built on August 8, 2024), I get such an output:
testing : 42
before suite
after suite
While logically everything is correct, the order of the output is not: before suite should come before testing: 42.
The interesting part is that if I run the package where this MySuite resides, the output is now in the correct order.
Is this expected?
Thank you.