You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JUnit 5 allows to use methods without any access modifier. Developers do not need to add public modifier and test classes are more readable. These test methods without any access modifier and with @Test annotation are marked in NetBeans as unused. This is not correct behaviour because these methods are used by the JUnit 5 runner.
importorg.junit.jupiter.api.Test;
classTestClass {
@TestvoidunusedTestMethod() { // <-- this is marked as unused// test code
}
}
It would be really nice to remove this false positive warning or disable some hints only in test files.
Note:
There are multiple annotations which mark test methods e.g. @ParamatrizedTest so it should check if method has anywhere @Testable annotation.
Use case/motivation
The test classes contain many warnings and it is easy to overlook some meaningful warning/error.
Related issues
No response
Are you willing to submit a pull request?
No
The text was updated successfully, but these errors were encountered:
Description
JUnit 5 allows to use methods without any access modifier. Developers do not need to add
public
modifier and test classes are more readable. These test methods without any access modifier and with@Test
annotation are marked in NetBeans as unused. This is not correct behaviour because these methods are used by the JUnit 5 runner.It would be really nice to remove this false positive warning or disable some hints only in test files.
Note:
There are multiple annotations which mark test methods e.g.
@ParamatrizedTest
so it should check if method has anywhere@Testable
annotation.Use case/motivation
The test classes contain many warnings and it is easy to overlook some meaningful warning/error.
Related issues
No response
Are you willing to submit a pull request?
No
The text was updated successfully, but these errors were encountered: