diff options
author | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-03-17 17:02:52 +0100 |
---|---|---|
committer | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-03-17 17:02:52 +0100 |
commit | 226dbe10061eb8f25a32c9becde26f1851f77994 (patch) | |
tree | 459d84a2c73dff87f493b8b7e2cc2b5365951391 /sonar-batch/src/test | |
parent | 6486c5e71c91cb6177fcd3adb5b04412790c290c (diff) | |
download | sonarqube-226dbe10061eb8f25a32c9becde26f1851f77994.tar.gz sonarqube-226dbe10061eb8f25a32c9becde26f1851f77994.zip |
SONAR-5094 Do not let the HTTP exception be swallowed by the underlying lib
Diffstat (limited to 'sonar-batch/src/test')
-rw-r--r-- | sonar-batch/src/test/java/org/sonar/batch/qualitygate/QualityGateProviderTest.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sonar-batch/src/test/java/org/sonar/batch/qualitygate/QualityGateProviderTest.java b/sonar-batch/src/test/java/org/sonar/batch/qualitygate/QualityGateProviderTest.java index 4e8cf612c2c..1c34d5add48 100644 --- a/sonar-batch/src/test/java/org/sonar/batch/qualitygate/QualityGateProviderTest.java +++ b/sonar-batch/src/test/java/org/sonar/batch/qualitygate/QualityGateProviderTest.java @@ -65,7 +65,7 @@ public class QualityGateProviderTest { public void should_load_empty_quality_gate_using_name() { String qGateName = "Sonar way"; when(settings.getString("sonar.qualitygate")).thenReturn(qGateName); - when(client.request("/api/qualitygates/show?name=Sonar way")).thenReturn("{'id':12345,'name':'Sonar way'}"); + when(client.request("/api/qualitygates/show?name=Sonar way", false)).thenReturn("{'id':12345,'name':'Sonar way'}"); QualityGate qGate = new QualityGateProvider().init(settings, client, metricFinder, logger); assertThat(qGate.name()).isEqualTo(qGateName); assertThat(qGate.isEnabled()).isTrue(); @@ -78,7 +78,7 @@ public class QualityGateProviderTest { long qGateId = 12345L; String qGateName = "Sonar way"; when(settings.getString("sonar.qualitygate")).thenReturn(Long.toString(qGateId)); - when(client.request("/api/qualitygates/show?id=12345")).thenReturn("{'id':12345,'name':'Sonar way','conditions':[" + when(client.request("/api/qualitygates/show?id=12345", false)).thenReturn("{'id':12345,'name':'Sonar way','conditions':[" + "{'id':1,'metric':'metric1','op':'EQ','warning':'POLOP'}," + "{'id':2,'metric':'metric2','op':'NE','error':'PALAP','period':3}" + "]}"); @@ -106,7 +106,7 @@ public class QualityGateProviderTest { public void should_stop_analysis_if_gate_not_found() { String qGateName = "Sonar way"; when(settings.getString("sonar.qualitygate")).thenReturn(qGateName); - when(client.request("/api/qualitygates/show?name=Sonar way")).thenThrow( + when(client.request("/api/qualitygates/show?name=Sonar way", false)).thenThrow( new HttpDownloader.HttpException(URI.create("/api/qualitygates/show?name=Sonar%20way"), HttpURLConnection.HTTP_NOT_FOUND)); new QualityGateProvider().provide(settings, client, metricFinder); } @@ -115,7 +115,7 @@ public class QualityGateProviderTest { public void should_stop_analysis_if_server_error() { String qGateName = "Sonar way"; when(settings.getString("sonar.qualitygate")).thenReturn(qGateName); - when(client.request("/api/qualitygates/show?name=Sonar way")).thenThrow( + when(client.request("/api/qualitygates/show?name=Sonar way", false)).thenThrow( new HttpDownloader.HttpException(URI.create("/api/qualitygates/show?name=Sonar%20way"), HttpURLConnection.HTTP_NOT_ACCEPTABLE)); new QualityGateProvider().provide(settings, client, metricFinder); } |