diff options
author | Klaudio Sinani <klaudio.sinani@sonarsource.com> | 2022-04-19 14:54:46 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-04-21 20:02:49 +0000 |
commit | 9eac13aaa5b3c6151e1c1954573a80e01c12b564 (patch) | |
tree | 3a1dcd9c3a00ad10e7c7b94a55d9324087050d67 /sonar-scanner-engine | |
parent | 4e770aa94bc813d6c8598eb86ec283fd48dfd970 (diff) | |
download | sonarqube-9eac13aaa5b3c6151e1c1954573a80e01c12b564.tar.gz sonarqube-9eac13aaa5b3c6151e1c1954573a80e01c12b564.zip |
SONAR-16290 Minor fix for unit-tests
Diffstat (limited to 'sonar-scanner-engine')
-rw-r--r-- | sonar-scanner-engine/src/test/java/org/sonar/scm/git/CompositeBlameCommandTest.java | 2 | ||||
-rw-r--r-- | sonar-scanner-engine/src/test/java/org/sonar/scm/git/GitScmProviderTest.java | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scm/git/CompositeBlameCommandTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scm/git/CompositeBlameCommandTest.java index af610eae2c5..5b566b72724 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scm/git/CompositeBlameCommandTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scm/git/CompositeBlameCommandTest.java @@ -170,6 +170,8 @@ public class CompositeBlameCommandTest { javaUnzip("dummy-git.zip", projectDir); File baseDir = new File(projectDir, "dummy-git"); + DefaultFileSystem fs = new DefaultFileSystem(baseDir); + when(input.fileSystem()).thenReturn(fs); String relativePath2 = "src/main/java/org/dummy/Dummy2.java"; DefaultInputFile inputFile = new TestInputFileBuilder("foo", DUMMY_JAVA) .setModuleBaseDir(baseDir.toPath()) diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scm/git/GitScmProviderTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scm/git/GitScmProviderTest.java index d7f5006e035..af58e703ef6 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scm/git/GitScmProviderTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scm/git/GitScmProviderTest.java @@ -142,7 +142,7 @@ public class GitScmProviderTest { CompositeBlameCommand compositeBlameCommand = new CompositeBlameCommand(analysisWarnings, new PathResolver(), jblameCommand, nativeBlameCommand); GitScmProvider gitScmProvider = new GitScmProvider(compositeBlameCommand, analysisWarnings, gitIgnoreCommand, system2); - assertThat(gitScmProvider.blameCommand()).isEqualTo(jblameCommand); + assertThat(gitScmProvider.blameCommand()).isEqualTo(compositeBlameCommand); } /** |