java:S2187 false positive for @Nested tests

Hello everyone,

I’ve noticed that rule java:S2187 adds an issue “Add some tests to this class.” even if test is structured as:

class SomeTest {
  @Nested
  class Nested {
    @Test
    void testSomething() {
       ...
    }
  }
}

I am using SonarQube Community Build v24.12.0.100206.

Thank you for great product you’ve built!

Hi,

Welcome to the community!

Only the latest version of SonarQube Community Build is considered active, so you’ll need to update and see if the situation is still replicable before we can help you.

Your update path is:

24.12 → 25.8

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

If your FP persists after update, please come back to us!

Hi!

I’m using SonarQube Cloud and this same false-positive situation happens here.