aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws-client
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2013-06-17 11:48:18 +0200
committerJulien HENRY <julien.henry@sonarsource.com>2013-06-17 11:48:57 +0200
commitbec922a214185c8a16e5766df4f4371a7af40a13 (patch)
tree1efbbc118f2db5cd95a412be9a46d540580299db /sonar-ws-client
parent12c2abe521f615bef5070c130a54cb2e001b377d (diff)
downloadsonarqube-bec922a214185c8a16e5766df4f4371a7af40a13.tar.gz
sonarqube-bec922a214185c8a16e5766df4f4371a7af40a13.zip
Fix Sonar UT on French OS
Diffstat (limited to 'sonar-ws-client')
-rw-r--r--sonar-ws-client/src/test/java/org/sonar/wsclient/internal/HttpRequestFactoryTest.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/sonar-ws-client/src/test/java/org/sonar/wsclient/internal/HttpRequestFactoryTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/internal/HttpRequestFactoryTest.java
index dcd8553da77..fdf537b1fa7 100644
--- a/sonar-ws-client/src/test/java/org/sonar/wsclient/internal/HttpRequestFactoryTest.java
+++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/internal/HttpRequestFactoryTest.java
@@ -44,7 +44,7 @@ public class HttpRequestFactoryTest {
httpServer.doReturnStatus(200).doReturnBody("{'issues': []}");
HttpRequestFactory factory = new HttpRequestFactory(httpServer.url());
- String json = factory.get("/api/issues", Collections.<String, Object>emptyMap());
+ String json = factory.get("/api/issues", Collections.<String, Object> emptyMap());
assertThat(json).isEqualTo("{'issues': []}");
assertThat(httpServer.requestedPath()).isEqualTo("/api/issues");
@@ -54,13 +54,12 @@ public class HttpRequestFactoryTest {
public void should_throw_illegal_state_exc_if_connect_exception() {
HttpRequestFactory factory = new HttpRequestFactory("http://localhost:1");
try {
- factory.get("/api/issues", Collections.<String, Object>emptyMap());
+ factory.get("/api/issues", Collections.<String, Object> emptyMap());
fail();
} catch (Exception e) {
assertThat(e).isInstanceOf(IllegalStateException.class);
assertThat(e).hasMessage("Fail to request http://localhost:1/api/issues");
- assertThat(e.getCause().getMessage()).contains("Connection refused");
-
+ assertThat(e.getCause().getMessage()).matches(".*(Connection refused|Connexion refusée).*");
}
}
@@ -69,7 +68,7 @@ public class HttpRequestFactoryTest {
httpServer.doReturnStatus(200).doReturnBody("{}");
HttpRequestFactory factory = new HttpRequestFactory(httpServer.url());
- String json = factory.post("/api/issues/change", Collections.<String, Object>emptyMap());
+ String json = factory.post("/api/issues/change", Collections.<String, Object> emptyMap());
assertThat(json).isEqualTo("{}");
assertThat(httpServer.requestedPath()).isEqualTo("/api/issues/change");
@@ -80,7 +79,7 @@ public class HttpRequestFactoryTest {
httpServer.doReturnStatus(200).doReturnBody("{}");
HttpRequestFactory factory = new HttpRequestFactory(httpServer.url()).setLogin("karadoc").setPassword("legrascestlavie");
- String json = factory.get("/api/issues", Collections.<String, Object>emptyMap());
+ String json = factory.get("/api/issues", Collections.<String, Object> emptyMap());
assertThat(json).isEqualTo("{}");
assertThat(httpServer.requestedPath()).isEqualTo("/api/issues");
@@ -90,10 +89,10 @@ public class HttpRequestFactoryTest {
@Test
public void test_proxy() throws Exception {
HttpRequestFactory factory = new HttpRequestFactory(httpServer.url())
- .setProxyHost("localhost").setProxyPort(1)
- .setProxyLogin("john").setProxyPassword("smith");
+ .setProxyHost("localhost").setProxyPort(1)
+ .setProxyLogin("john").setProxyPassword("smith");
try {
- factory.get("/api/issues", Collections.<String, Object>emptyMap());
+ factory.get("/api/issues", Collections.<String, Object> emptyMap());
fail();
} catch (IllegalStateException e) {
// it's not possible to check that the proxy is correctly configured