From adb461a0df7188b1d6f1ec14403777ddd6e502bd Mon Sep 17 00:00:00 2001 From: Arshan Dabirsiaghi Date: Fri, 21 Jun 2024 13:43:54 -0400 Subject: [PATCH] Improved failedfix line verification (#392) --- .../test/java/io/codemodder/codemods/SonarXXECodemodTest.java | 2 +- .../src/main/java/io/codemodder/testutils/ExpectedFixes.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core-codemods/src/test/java/io/codemodder/codemods/SonarXXECodemodTest.java b/core-codemods/src/test/java/io/codemodder/codemods/SonarXXECodemodTest.java index a89803d5b..7d01f25ec 100644 --- a/core-codemods/src/test/java/io/codemodder/codemods/SonarXXECodemodTest.java +++ b/core-codemods/src/test/java/io/codemodder/codemods/SonarXXECodemodTest.java @@ -7,6 +7,6 @@ codemodType = SonarXXECodemod.class, testResourceDir = "sonar-xxe-s2755", renameTestFile = "src/main/java/com/acme/XXEVuln.java", - expectingFailedFixesAtLines = {62}, + expectingFixesAtLines = {53, 62, 68}, dependencies = {}) final class SonarXXECodemodTest implements CodemodTestMixin {} diff --git a/framework/codemodder-testutils/src/main/java/io/codemodder/testutils/ExpectedFixes.java b/framework/codemodder-testutils/src/main/java/io/codemodder/testutils/ExpectedFixes.java index 65a0bfdd8..df64a350f 100644 --- a/framework/codemodder-testutils/src/main/java/io/codemodder/testutils/ExpectedFixes.java +++ b/framework/codemodder-testutils/src/main/java/io/codemodder/testutils/ExpectedFixes.java @@ -46,7 +46,7 @@ static void verifyExpectedFixes( List unfixedFindings = result.getUnfixedFindings(); for (int expectedFailedFixLine : expectingFailedFixesAtLines) { assertThat( - unfixedFindings.stream().noneMatch(c -> c.getLine() == expectedFailedFixLine), is(true)); + unfixedFindings.stream().anyMatch(c -> c.getLine() == expectedFailedFixLine), is(true)); } }