diff options
author | Duarte Meneses <duarte.meneses@sonarsource.com> | 2015-11-24 14:16:07 +0100 |
---|---|---|
committer | Duarte Meneses <duarte.meneses@sonarsource.com> | 2015-11-24 14:21:20 +0100 |
commit | 5634bf689509aed3c48877469d4549ab7b5141a4 (patch) | |
tree | bb48c7504eab88f37e48bda7f6b23f869b570db1 /sonar-batch/src/test | |
parent | 0ef2119bf5961312426fe855b6e0beb82c46c297 (diff) | |
download | sonarqube-5634bf689509aed3c48877469d4549ab7b5141a4.tar.gz sonarqube-5634bf689509aed3c48877469d4549ab7b5141a4.zip |
SONAR-7037 Improve logging on authentication failure
Diffstat (limited to 'sonar-batch/src/test')
-rw-r--r-- | sonar-batch/src/test/java/org/sonar/batch/repository/DefaultProjectRepositoriesLoaderTest.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sonar-batch/src/test/java/org/sonar/batch/repository/DefaultProjectRepositoriesLoaderTest.java b/sonar-batch/src/test/java/org/sonar/batch/repository/DefaultProjectRepositoriesLoaderTest.java index 2641fc2b536..b8c9012399a 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/repository/DefaultProjectRepositoriesLoaderTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/repository/DefaultProjectRepositoriesLoaderTest.java @@ -19,6 +19,8 @@ */ package org.sonar.batch.repository; +import org.sonar.api.utils.MessageException; + import com.google.common.io.Resources; import java.io.ByteArrayInputStream; @@ -81,6 +83,17 @@ public class DefaultProjectRepositoriesLoaderTest { when(wsLoader.loadStream(anyString())).thenThrow(e); loader.load(PROJECT_KEY, false, null); } + + @Test + public void failFastHttpErrorMessageException() { + thrown.expect(MessageException.class); + thrown.expectMessage("http error"); + + HttpException http = new HttpException(URI.create("uri"), 403); + MessageException e = MessageException.of("http error", http); + when(wsLoader.loadStream(anyString())).thenThrow(e); + loader.load(PROJECT_KEY, false, null); + } @Test public void passIssuesModeParameter() { |