From 369eb731d47e5d6e2a9016f0d6db6f3c272b1c18 Mon Sep 17 00:00:00 2001 From: Julien HENRY Date: Tue, 2 Apr 2024 14:47:45 +0200 Subject: SONAR-21972 Fix tests to not depend on the operating system's locale --- .../src/test/java/org/sonar/scm/git/ProcessWrapperFactoryTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sonar-scanner-engine/src/test') diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scm/git/ProcessWrapperFactoryTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scm/git/ProcessWrapperFactoryTest.java index 1eaa3c5cff6..ed7b600cd25 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scm/git/ProcessWrapperFactoryTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scm/git/ProcessWrapperFactoryTest.java @@ -20,6 +20,7 @@ package org.sonar.scm.git; import java.io.IOException; +import java.util.Map; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -41,8 +42,8 @@ public class ProcessWrapperFactoryTest { public void should_log_error_output_in_debug_mode() throws IOException { logTester.setLevel(Level.DEBUG); var root = temp.newFolder().toPath(); - var processWrapper = underTest.create(root, v -> {}, "git", "blame"); - assertThatThrownBy(() -> processWrapper.execute()) + var processWrapper = underTest.create(root, v -> {}, Map.of("LANG", "en_US"), "git", "blame"); + assertThatThrownBy(processWrapper::execute) .isInstanceOf(IllegalStateException.class); assertThat(logTester.logs(Level.DEBUG).get(0)).startsWith("fatal:"); -- cgit v1.2.3