Test Class Order

Learn how to control the order in which test classes are executed in JUnit 5.

Execution order of test classes

We can also control the execution order of test classes. This is done by using the org.junit.jupiter.api.TestClassOrder annotation and org.junit.jupiter.api.ClassOrderer interface. The ClassOrderer also has four built-in implementations.

Get hands-on with 1200+ tech skills courses.