Done
Pinned fields
Click on the next to a field label to start pinning.
Details
Assignee
Erwan SérandourErwan SérandourReporter
Leonardo PilastriLeonardo PilastriLabels
Start date
Dec 05, 2024Components
Fix versions
Priority
Normal
Details
Details
Assignee
Erwan Sérandour
Erwan SérandourReporter
Leonardo Pilastri
Leonardo PilastriLabels
Start date
Dec 05, 2024
Components
Fix versions
Priority

Sentry
Sentry
Sentry
Created February 28, 2023 at 12:57 PM
Updated December 16, 2024 at 2:47 PM
Resolved December 12, 2024 at 10:41 AM
Rule S2187 states that test classes should not be empty. NoTestInTestClassCheck is implemented to have different behaviors when dealing with TestNg library. If the class is annotated with
@org.testng.annotations.Test
the check expects to find at least one test method that is alsopublic
, instead if the same annotation is not on the class, but only on the methods inside, they can all be private without any issue.TestNg does not require any test method to be public, so the check should behave accordingly and should not raise if the test method is not public.
Non-compliant example:
@org.testng.annotations.Test(groups = "unitTests") class CommunityTest{ // Noncompliant {Add some tests to this class.} @Test void fun() { } }
In this example, just by removing the class annotation, the issue is resolved.