aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <jeremy.katz@sonarsource.com>2025-06-18 16:54:51 -0400
committersonartech <sonartech@sonarsource.com>2025-06-19 20:03:07 +0000
commit2f5de193f70bf07fd7ffa2c49d20c875863f03a9 (patch)
treef12baadb7f88f8f9a305206d2ad7f58f2c8a058b
parent207ba0c517089f588afb1ed981abb5b1ae9b0db3 (diff)
downloadsonarqube-2f5de193f70bf07fd7ffa2c49d20c875863f03a9.tar.gz
sonarqube-2f5de193f70bf07fd7ffa2c49d20c875863f03a9.zip
SCA-409 Test fix: args with commas cause problems on Windows
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/sca/CliServiceTest.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/sca/CliServiceTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/sca/CliServiceTest.java
index 47d8a8d1d85..89bdee60d18 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/sca/CliServiceTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/sca/CliServiceTest.java
@@ -269,14 +269,14 @@ class CliServiceTest {
@Test
void generateZip_withExcludedManifestsContainingBadCharacters_handlesTheBadCharacters() throws Exception {
when(configuration.getStringArray(CliService.SCA_EXCLUSIONS_KEY)).thenReturn(new String[] {
- "**/test/**", "**/path with spaces/**", "**/path,with,commas/**", "**/path'with'quotes/**", "**/path\"with\"double\"quotes/**"});
+ "**/test/**", "**/path with spaces/**", "**/path'with'quotes/**", "**/path\"with\"double\"quotes/**"});
underTest.generateManifestsZip(rootInputModule, scriptDir(), configuration);
String capturedArgs = logTester.logs().stream().filter(log -> log.contains("Arguments Passed In:")).findFirst().get();
String expectedExcludeFlag = """
- --exclude **/test/**,**/path with spaces/**,"**/path,with,commas/**",**/path'with'quotes/**,"**/path""with""double""quotes/**",ignored.txt
+ --exclude **/test/**,**/path with spaces/**,**/path'with'quotes/**,"**/path""with""double""quotes/**",ignored.txt
""".strip();
assertThat(capturedArgs).contains(expectedExcludeFlag);
}