You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "Saljack (via GitHub)" <gi...@apache.org> on 2023/10/11 13:28:25 UTC
[I] Test methods without modifier are marked as unused [netbeans]
Saljack opened a new issue, #6557:
URL: https://github.com/apache/netbeans/issues/6557
### 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.
```java
import org.junit.jupiter.api.Test;
class TestClass {
@Test
void unusedTestMethod() { // <-- 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] Test methods without modifier are marked as unused [netbeans]
Posted by "Saljack (via GitHub)" <gi...@apache.org>.
Saljack closed issue #6557: Test methods without modifier are marked as unused
URL: https://github.com/apache/netbeans/issues/6557
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] Test methods without modifier are marked as unused [netbeans]
Posted by "Saljack (via GitHub)" <gi...@apache.org>.
Saljack commented on issue #6557:
URL: https://github.com/apache/netbeans/issues/6557#issuecomment-1961261754
Yes it is fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [I] Test methods without modifier are marked as unused [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on issue #6557:
URL: https://github.com/apache/netbeans/issues/6557#issuecomment-1761370481
this got likely fixed in NB 20 via #6277
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists