Affects PMD Version: 6.30.0-SNAPSHOT
Rule: JUnitAssertionsShouldIncludeMessage
Description:
From #2871 (comment)
Code Sample demonstrating the issue:
https://chunk.io/pmd/fc7db65b2c6a46eca4c9a0c3012482e2/diff/spring-framework/index.html#A6120
import static org.junit.Assert.assertEquals;
public class AssertionMessageTest {
public void bar(int expectedLength) {
try {
Integer.parseInt("a");
} catch (RuntimeException e) {
assertEquals(e.toString(), expectedLength, e.getMessage().length()); // no warning expected
}
}
}
Expected outcome:
- Does PMD report a violation, where there shouldn't be one? -> false-positive
Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
Affects PMD Version: 6.30.0-SNAPSHOT
Rule: JUnitAssertionsShouldIncludeMessage
Description:
From #2871 (comment)
Code Sample demonstrating the issue:
https://chunk.io/pmd/fc7db65b2c6a46eca4c9a0c3012482e2/diff/spring-framework/index.html#A6120
Expected outcome:
Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]