Skip to content

Instantly share code, notes, and snippets.

@nipafx
Created March 18, 2016 12:57
Show Gist options
  • Save nipafx/08a70cd2b6b94ab8b41d to your computer and use it in GitHub Desktop.
Save nipafx/08a70cd2b6b94ab8b41d to your computer and use it in GitHub Desktop.
Running JUnit 5 tests with JUnit 4
package org.codefx.demo.junit5;
import org.junit.gen5.api.Test;
import org.junit.gen5.junit4.runner.JUnit5;
import org.junit.runner.RunWith;
/**
* Typical "Hello World"; runs as a JUnit 4 test.
*/
@RunWith(JUnit5.class)
public class HelloWorldSelfContained {
@Test
void helloJUnit5() {
System.out.println("Hello, JUnit 5.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment