diff options
author | Lukasz Jarocki <lukasz.jarocki@sonarsource.com> | 2023-04-06 10:48:18 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-02-12 20:02:28 +0000 |
commit | 862dc5ac73288758314237c15bfd1e84daa10d31 (patch) | |
tree | 992b30f2bf9bdea7fb24209884a3714cc045396b | |
parent | 4d93cac249902e65de931eda25fb8750d78e6606 (diff) | |
download | sonarqube-862dc5ac73288758314237c15bfd1e84daa10d31.tar.gz sonarqube-862dc5ac73288758314237c15bfd1e84daa10d31.zip |
SONAR-18799 made one of the test more tolerant to type of exceptions expected
(cherry picked from commit e5564c45cd59815afa34f055628555c4eb0da403)
-rw-r--r-- | server/sonar-ce/src/test/java/org/sonar/ce/httpd/CeHttpServerTest.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/server/sonar-ce/src/test/java/org/sonar/ce/httpd/CeHttpServerTest.java b/server/sonar-ce/src/test/java/org/sonar/ce/httpd/CeHttpServerTest.java index 550f50a84b6..cba60a14011 100644 --- a/server/sonar-ce/src/test/java/org/sonar/ce/httpd/CeHttpServerTest.java +++ b/server/sonar-ce/src/test/java/org/sonar/ce/httpd/CeHttpServerTest.java @@ -22,6 +22,7 @@ package org.sonar.ce.httpd; import java.io.File; import java.io.IOException; import java.net.ConnectException; +import java.net.SocketTimeoutException; import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Properties; @@ -110,11 +111,11 @@ public class CeHttpServerTest { } @Test - public void stop_stops_http_server() throws Exception { + public void stop_stops_http_server() { underTest.stop(); - + assertThatThrownBy(() -> call(underTest.getUrl())) - .isInstanceOf(ConnectException.class); + .isInstanceOfAny(ConnectException.class, SocketTimeoutException.class); } @Test |