diff --git a/core-codemods/src/intTest/java/io/codemodder/integration/WebGoat822Test.java b/core-codemods/src/intTest/java/io/codemodder/integration/WebGoat822Test.java index acf06f9d0..3254dfcfc 100644 --- a/core-codemods/src/intTest/java/io/codemodder/integration/WebGoat822Test.java +++ b/core-codemods/src/intTest/java/io/codemodder/integration/WebGoat822Test.java @@ -52,8 +52,11 @@ void it_injects_dependency_even_when_no_poms_included() throws Exception { verifyNoFailedFiles(report); List results = report.getResults(); - assertThat(results.size(), is(1)); - CodeTFResult result = results.get(0); + CodeTFResult result = + results.stream() + .filter(r -> r.getCodemod().equals("pixee:java/harden-java-deserialization")) + .findFirst() + .orElseThrow(); List changeset = result.getChangeset(); assertThat(changeset.size(), is(3)); assertThat( diff --git a/framework/codemodder-base/src/main/java/io/codemodder/CLI.java b/framework/codemodder-base/src/main/java/io/codemodder/CLI.java index 03f023e44..30d3b30e0 100644 --- a/framework/codemodder-base/src/main/java/io/codemodder/CLI.java +++ b/framework/codemodder-base/src/main/java/io/codemodder/CLI.java @@ -447,9 +447,8 @@ public Integer call() throws IOException { log.info("running codemod: {}", codemod.getId()); CodeTFResult result = codemodExecutor.execute(filePaths); - if (!result.getChangeset().isEmpty() || !result.getFailedFiles().isEmpty()) { - results.add(result); - } + results.add(result); + if (!result.getChangeset().isEmpty()) { log.info("changed:"); result