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
I'm using custom test framework and maven plugin: https://github.com/g4s8/oot/
I have several test-case classes in the project under src/test/java path, all names of test cases ends with *Test. But Qulice fails with JUnit4TestShouldUseTestAnnotation and TestClassWithoutTestCases because I don't have any @Test annotation in test classes:
This class name ends with Test but contains no test cases (TestClassWithoutTestCases)
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest (JUnit4TestShouldUseTestAnnotation)
To build it I need to add this line to each test class:
@g4s8/z this project will fix the problem faster if you donate a few dollars to it; just click here and pay via Stripe, it's very fast, convenient and appreciated; thanks a lot!
@g4s8@yegor256
If I understand correctly, this is correct behavior link.
The rule TestClassWithoutTestCases should warn you in your case: Since you have a class, which has "TestCase" in its name (or in your case, extends a class with TestCase in its name), you express the intention, that this class is indeed a class containing test cases. If there are no test methods, then you trigger the rule.
@yegor256 Do you really think we need to disable this PMD option (we could probably override the TestClassWithoutTestCasesRule class and disable the isTestClassByPattern method)?
I'm using custom test framework and maven plugin: https://github.com/g4s8/oot/
I have several test-case classes in the project under
src/test/java
path, all names of test cases ends with*Test
. But Qulice fails withJUnit4TestShouldUseTestAnnotation
andTestClassWithoutTestCases
because I don't have any@Test
annotation in test classes:To build it I need to add this line to each test class:
The text was updated successfully, but these errors were encountered: