Q:

How do detect missing @Nested annotations?

When using nested tests, my team has found that sometimes we forget to add an @Nested annotation to an inner class.
This leads to a "false negative" test suite -- all tests are green but in reality there's a subset of the tests that are not running at all, and may indeed be broken.
Are there any existing tools that can help us spot this automatically?

A:

To the best of my knowledge, there is currently no tool that will help you in that regard.
As far as JUnit Jupiter itself is concerned, we (the JUnit 5 team) are planning to overhaul diagnostics for such scenarios in a future release.
Feel free to chime in with your thoughts and concerns here:
https://github.com/junit-team/junit5/issues/242

