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/0388b0f534b0ad61cb39 to your computer and use it in GitHub Desktop.
Save stephan-mueller/0388b0f534b0ad61cb39 to your computer and use it in GitHub Desktop.
JUnit test to demonstrate the method execution order defined by the name.
@FixMethodOrder(NAME_ASCENDING)
public class FixMethodOrderNameAscendingTest {
private static final Logger LOG = LoggerFactory.getLogger(FixMethodOrderNameAscendingTest.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