A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/3614 below:

[java] JUnitTestsShouldIncludeAssert doesn't consider nested classes · Issue #3614 · pmd/pmd · GitHub

Affects PMD Version: 6.40.0

Rule: JUnitTestsShouldIncludeAssert

Description: JUnit5 supports defining nested test classes. These should also be considered by the rule.

Code Sample demonstrating the issue:

import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;

public class BigTest {
    @Nested
    class InnerTestCases {
        @Test
        void check() {
            // empty, missing assert
        }
    }
}

Expected outcome:

PMD should report a violation at line 8, but doesn't. This is a false-negative.

Note - found via #2687


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4