White Box Testing
Test your code
   Home      JUnit4-Test-Method-Execution-Ordering

Test method execution ordering

By default method executed in the order returned by the reflection API. To change the test execution order simply annotate your test class using @FixMethodOrder and specify one of the available MethodSorters:

@FixMethodOrder(MethodSorters.JVM): Leaves the test methods in the order returned by the JVM. This order may vary from run to run.

@FixMethodOrder(MethodSorters.NAME_ASCENDING): Sorts the test methods by method name, in lexicographic order.