Tests run with JUnit jupiter and JUnit vintage

Answered

I'm trying to execute some tests using only JUnit jupiter, however, on execution, JUnit Vintage and JUnit Jupiter is being used. Only one test is being run in JUnit vintage and that's the first test. This test fails because it depends on a setup method which is annotated with org.junit.jupiter.api.BeforeAll, this setup method isn't called until after the vintage execution is finished, at which point junit jupiter execution starts and the BeforeAll method is called and tests pass.

A temporary solution is to change the name of that first test method so it doesn't start with "test". When I do this, junit vintage still runs but instead of failing the test, gives me a warning with exception: "junit.framework.AssertionFailedError: No tests found in <package name omitted>.TestClass".

I have the following 2 dependencies using intellij dependency system:

org.junit.platform:junit-platform-launcher:1.6.0
org.junit.jupiter:junit-jupiter-api:5.6.2

Any advice on how I can stop the JUnit Vintage engine from being used would be greatly appreciated,
Alex.

1 comment
Comment actions Permalink

Hello,

Can you please share a sample project demonstrating the issue. You may attach it to the issue created at YouTrack: https://youtrack.jetbrains.com/ or upload it here: http://uploads.services.jetbrains.com/

Thank you 

0

Please sign in to leave a comment.