Skip to content

Instantly share code, notes, and snippets.

@stephan-mueller
Created September 28, 2015 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephan-mueller/348170e0b57a43814e9c to your computer and use it in GitHub Desktop.
Save stephan-mueller/348170e0b57a43814e9c to your computer and use it in GitHub Desktop.
JUnit test to demonstrate the method execution order defined by the JVM.
@FixMethodOrder(JVM)
public class FixMethodOrderJVMTest {
private static final Logger LOG = LoggerFactory.getLogger(FixMethodOrderJVMTest.class);
@Rule
public TestName name = new TestName();
@Test
public void methodB() throws Exception {
LOG.info("@Test " + name.getMethodName());
}
@Test
public void methodA() throws Exception {
LOG.info("@Test " + name.getMethodName());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment