I use Java 11 ( I'm not looking for the order of execution of methods within a class.)
There are no posts on the site that answer my question
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Suite.SuiteClasses({TestFirst.class,
TestSecond.class,
AdminTest.class})
public class ApplicationTests {
}
public class TestFirst extends ApplicationTests {
@Test
void run(){
}
}
public class TestSecond extends ApplicationTests {
@Test
void run(){
}
}
public class AdminTest extends ApplicationTests {
@Test
void run(){
}
}
I use the annotation @Suite.SuiteClasses.
I assume that the test classes should be run one by one. The launch order is not followed. Each class is located in its own directory.
For Spring, it's like a separate integration test.
How can I get the classes to execute in the order I defined ?
Maybe there is another approach for this ?