I have created a project which proves that it works with Surefire 3.0.0-M5,
JUnit Jupiter 5.8.2 and Mockito Extension. Please do not use JUnit4 and
Vintage in this case. It is not necessary to use a dependency inside of the
plugin. Use a dependency in the project POM. Follow it on Github:
https://github.com/Tibor17/junit5-mockito-examples

[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @
why-is-surefire-not-executing-my-junit5-tests ---
[INFO]
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running pkg.BDSHelperTest
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
0.396 s - in pkg.BDSHelperTest
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO]
------------------------------------------------------------------------
[INFO] Total time:  6.417 s
[INFO] Finished at: 2022-03-19T21:15:10+01:00
[INFO]
------------------------------------------------------------------------


The XML test report:
<testcase name="test" classname="pkg.BDSHelperTest" time="0.454"/>


Cheers
Tibor


On Sat, Mar 19, 2022 at 6:53 AM David Karr <davidmichaelk...@gmail.com>
wrote:

> I, along with two other people on my team, have spent days and days now
> trying to figure out why we cannot get Surefire to execute JUnit 5 tests.
> We've all been working independently, so we don't all take the same path,
> but it didn't really matter, as all three of us are pretty much stuck at
> the same point.  We can execute JUnit 5 tests in Eclipse, but Surefire just
> refuses to have anything to do with JUnit 5 tests.  We've all read numerous
> threads and posts on how to do it, and it just does not work.
>
> Most recently, I posted this question with some details of what I had done
> so far:
>
> https://stackoverflow.com/questions/71531001/why-is-surefire-not-executing-my-junit5-tests
> .
>
> I have no idea whether the problems lie in JUnit 5, or in Surefire, or some
> combination.  I wish I could get some debug output that told me SOMETHING.
> It just does not run JUnit 5 tests.
>

Reply via email to