]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-18799 made one of the test more tolerant to type of exceptions expected
authorLukasz Jarocki <lukasz.jarocki@sonarsource.com>
Thu, 6 Apr 2023 08:48:18 +0000 (10:48 +0200)
committersonartech <sonartech@sonarsource.com>
Mon, 12 Feb 2024 20:02:28 +0000 (20:02 +0000)
(cherry picked from commit e5564c45cd59815afa34f055628555c4eb0da403)

server/sonar-ce/src/test/java/org/sonar/ce/httpd/CeHttpServerTest.java

index 550f50a84b6766c04d44fc005eb4c05372d0a948..cba60a14011d0de86231a2f704d785afacdea50c 100644 (file)
@@ -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