diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2017-01-10 15:00:03 +0100 |
---|---|---|
committer | Duarte Meneses <duarte.meneses@sonarsource.com> | 2017-01-11 11:45:58 +0100 |
commit | 750fd412e0b11a071c5a3d2677cda289713d82e2 (patch) | |
tree | 7a86efb390f5e8e75a80d31058a7b858a2033882 /sonar-scanner-engine/src/test | |
parent | 60f2dd5f30366274cdb0942a3d1f07b095a5d002 (diff) | |
download | sonarqube-750fd412e0b11a071c5a3d2677cda289713d82e2.tar.gz sonarqube-750fd412e0b11a071c5a3d2677cda289713d82e2.zip |
SONAR-8518 "sonar.profile" makes the analysis fail in preview mode
Diffstat (limited to 'sonar-scanner-engine/src/test')
-rw-r--r-- | sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/QualityProfileProviderTest.java | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/QualityProfileProviderTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/QualityProfileProviderTest.java index e48ae464e58..604b89a9885 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/QualityProfileProviderTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/repository/QualityProfileProviderTest.java @@ -31,7 +31,6 @@ import org.sonar.api.batch.bootstrap.ProjectKey; import org.sonar.api.utils.log.LogTester; import org.sonar.api.utils.log.LoggerLevel; import org.sonar.scanner.analysis.AnalysisProperties; -import org.sonar.scanner.analysis.DefaultAnalysisMode; import org.sonar.scanner.repository.ProjectRepositories; import org.sonar.scanner.repository.QualityProfileLoader; import org.sonar.scanner.repository.QualityProfileProvider; @@ -56,8 +55,6 @@ public class QualityProfileProviderTest { @Mock private QualityProfileLoader loader; @Mock - private DefaultAnalysisMode mode; - @Mock private AnalysisProperties props; @Mock private ProjectKey key; @@ -81,7 +78,7 @@ public class QualityProfileProviderTest { @Test public void testProvide() { when(loader.load(eq("project"), isNull(String.class))).thenReturn(response); - ModuleQProfiles qps = qualityProfileProvider.provide(key, loader, projectRepo, props, mode); + ModuleQProfiles qps = qualityProfileProvider.provide(key, loader, projectRepo, props); assertResponse(qps); verify(loader).load(eq("project"), isNull(String.class)); @@ -92,7 +89,7 @@ public class QualityProfileProviderTest { public void testProjectDoesntExist() { when(projectRepo.exists()).thenReturn(false); when(loader.loadDefault(anyString())).thenReturn(response); - ModuleQProfiles qps = qualityProfileProvider.provide(key, loader, projectRepo, props, mode); + ModuleQProfiles qps = qualityProfileProvider.provide(key, loader, projectRepo, props); assertResponse(qps); verify(loader).loadDefault(anyString()); @@ -105,7 +102,7 @@ public class QualityProfileProviderTest { when(props.property(ModuleQProfiles.SONAR_PROFILE_PROP)).thenReturn("custom"); when(props.properties()).thenReturn(ImmutableMap.of(ModuleQProfiles.SONAR_PROFILE_PROP, "custom")); - ModuleQProfiles qps = qualityProfileProvider.provide(key, loader, projectRepo, props, mode); + ModuleQProfiles qps = qualityProfileProvider.provide(key, loader, projectRepo, props); assertResponse(qps); verify(loader).load(eq("project"), eq("custom")); @@ -115,26 +112,13 @@ public class QualityProfileProviderTest { } @Test - public void testIgnoreSonarProfileIssuesMode() { - when(mode.isIssues()).thenReturn(true); - when(loader.load(eq("project"), (String) eq(null))).thenReturn(response); - when(props.property(ModuleQProfiles.SONAR_PROFILE_PROP)).thenReturn("custom"); - - ModuleQProfiles qps = qualityProfileProvider.provide(key, loader, projectRepo, props, mode); - assertResponse(qps); - - verify(loader).load(eq("project"), (String) eq(null)); - verifyNoMoreInteractions(loader); - } - - @Test public void testProfilePropDefault() { when(projectRepo.exists()).thenReturn(false); when(loader.loadDefault(eq("custom"))).thenReturn(response); when(props.property(ModuleQProfiles.SONAR_PROFILE_PROP)).thenReturn("custom"); when(props.properties()).thenReturn(ImmutableMap.of(ModuleQProfiles.SONAR_PROFILE_PROP, "custom")); - ModuleQProfiles qps = qualityProfileProvider.provide(key, loader, projectRepo, props, mode); + ModuleQProfiles qps = qualityProfileProvider.provide(key, loader, projectRepo, props); assertResponse(qps); verify(loader).loadDefault(eq("custom")); |