From a223a2a944055a26d1291a48f856253bae988b62 Mon Sep 17 00:00:00 2001 From: Lukasz Jarocki Date: Thu, 6 Apr 2023 10:48:18 +0200 Subject: [PATCH] SONAR-18799 made one of the test more tolerant to type of exceptions expected --- .../src/test/java/org/sonar/ce/httpd/CeHttpServerTest.java | 7 ++++--- 1 file 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 4cec9bb1772..69697aef35a 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 -- 2.39.5