From 86438ca75515c5ed84ea0c1d9a2868effb925182 Mon Sep 17 00:00:00 2001 From: Arshan Dabirsiaghi Date: Tue, 23 Apr 2024 06:52:00 -0400 Subject: [PATCH] Inject Contrast finding XML files into test (#362) --- .../main/java/io/codemodder/testutils/CodemodTestMixin.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/codemodder-testutils/src/main/java/io/codemodder/testutils/CodemodTestMixin.java b/framework/codemodder-testutils/src/main/java/io/codemodder/testutils/CodemodTestMixin.java index 90b5ee2ca..1f2097e8d 100644 --- a/framework/codemodder-testutils/src/main/java/io/codemodder/testutils/CodemodTestMixin.java +++ b/framework/codemodder-testutils/src/main/java/io/codemodder/testutils/CodemodTestMixin.java @@ -124,6 +124,9 @@ private void verifyCodemod( // Check for any a defectdojo Path defectDojo = testResourceDir.resolve("defectdojo.json"); + // Check for Contrast + Path contrastXml = testResourceDir.resolve("contrast.xml"); + // run the codemod CodemodLoader loader = new CodemodLoader( @@ -137,7 +140,7 @@ private void verifyCodemod( List.of(), Files.exists(sonarJson) ? sonarJson : null, Files.exists(defectDojo) ? defectDojo : null, - null); + Files.exists(contrastXml) ? contrastXml : null); List codemods = loader.getCodemods(); assertThat(codemods.size(), equalTo(1));