As the java community progresses to use JUnit 5 instead of JUnit 4 please add support for JUnit 5 as well
I think it's more an issue with JUnit support of Eclipse JDT. I have created a bug for that https://bugs.eclipse.org/bugs/show_bug.cgi?id=531779
we'll support basic feature of JUnit5 in 0.4.0
@angelozerr - I don't think that the issue you raised in https://github.com/Microsoft/vscode-java-test/issues/93#issuecomment-369178017 is going to help with JUnit 5 support. When running JUnit 5 tests in Eclipse, the plugin uses the JUnit5 Engine for discovery and for execution. The structure of a JUnit5 test plan includes both tests and containers which can form an arbitrarily deep hierarchy (in practice it's fairly constrained. As an example, consider the following code:
public class MinimalJunitTests {
@Test
void test() {
}
@ParameterizedTest
@CsvSource({ "Test 1", "Test 2", "Test 3" })
void parameterizedTest(String parameter) {
}
@TestFactory
Stream<DynamicTest> dynamicTest() {
return Stream.of("One", "Two", "Three")
.map(s -> DynamicTest.dynamicTest(s, () -> {}));
}
@AlternateTestAnnotation
void alternateTest() {
}
@Nested
public class NestedMinimalTests {
@Test
void nestedTest() {
}
}
}
This class doesn't contain all the ways that JUnit5 tests can be created so it's not really suitable as a full example, but when run using Maven or Eclipse, this code executes nine test methods with the following hierarchy:

I'm a bit confused because DiscoveryRequestCreator looks like it's set up to use JUnit5 discovery - but I can't find anywhere to set-up the options that are required (or even find the default options).
After running a few more JUnit5 tests through VS Code's Java test extension I've also realized that the @DisplayName annotations are not being used when present. I can submit a separate issue for this problem if you want (along with a small code sample and Eclipse output.
In addition to @DisplayName not working @ParameterizedTest methods are not picked up. Likely reason is the junit-jupiter-params artifact is not included on the class path of the VS code runner.
Would be great if this worked out of the editor, but you can get by running mvn test or the Gradle equivalent for now.
We are working on refactoring the code with TestNG support right now and will be coming soon.
More support on Junit5 will be the next work item.
@jdneo I wouldn't be much help with TestNG but ping me if you need some help with the JUnit 5 work
@smoyer64 Much appreciated, thank you! 馃槃
Hi @all
To better track the work items, I'm going to closing this issue, you can check them separately in the following issues:
Most helpful comment
After running a few more JUnit5 tests through VS Code's Java test extension I've also realized that the
@DisplayNameannotations are not being used when present. I can submit a separate issue for this problem if you want (along with a small code sample and Eclipse output.