Running unit or integration tests in specific order with junit platform suite
The intention of this example is not to encourage running unit or integration test in a specific in the build. Instead this is a powerful and handy way to reproduce random build failure due to test clashing with each other or lack of isolation between tests. The fundamental idea is to temporarily create a junit platform suite and run the tests in the same order which caused the build failure and reproduce the failure in a consistent and deterministic way. Once the failure can be reliably reproduced, the clashing test can be easily narrowed down. In order to create this sample suite, we need the following test dependency: group id: org.junit.platform artifact id: junit-platform-suite version: <<latest>> Create a sample Junit suite and run it using your favourite IDE. package com.harishkannarao.test; import org.junit.platform.suite.api. SelectClasses ; import org.junit.platform.suite.api. Suite ; @Suite // order of the test classes is very important. E.g ExampleTest runs firs...