I want to execute test methods which are annotated by @Test
in specific order.
For example:
public class MyTest {
@Test public void
With JUnit 5.4, you can specify the order :
@Test
@Order(2)
public void sendEmailTestGmail() throws MessagingException {
you just need to annotate your class
@TestMethodOrder(OrderAnnotation.class)
https://junit.org/junit5/docs/current/user-guide/#writing-tests-test-execution-order
i'm using this in my project and it works very well !