From: Zipeng WU Date: Thu, 29 Dec 2022 15:11:34 +0000 (+0100) Subject: [NO-JIRA] Fix unittest that relies on no longer existing domain X-Git-Tag: 9.9.0.65466~134 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=db1874af5166749a7259d1f26b6e646ce9db3502;p=sonarqube.git [NO-JIRA] Fix unittest that relies on no longer existing domain --- diff --git a/server/sonar-server-common/src/test/java/org/sonar/server/webhook/WebhookCustomDnsTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/webhook/WebhookCustomDnsTest.java index 52aa46cd632..c5fe9025a9a 100644 --- a/server/sonar-server-common/src/test/java/org/sonar/server/webhook/WebhookCustomDnsTest.java +++ b/server/sonar-server-common/src/test/java/org/sonar/server/webhook/WebhookCustomDnsTest.java @@ -108,7 +108,7 @@ public class WebhookCustomDnsTest { when(networkInterfaceProvider.getNetworkInterfaceAddresses()) .thenThrow(new SocketException()); - Assertions.assertThatThrownBy(() -> underTest.lookup("good-url.com")) + Assertions.assertThatThrownBy(() -> underTest.lookup("sonarsource.com")) .hasMessageContaining("Network interfaces could not be fetched.") .isInstanceOf(IllegalArgumentException.class); } diff --git a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/webhook/ws/WebhookSupportTest.java b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/webhook/ws/WebhookSupportTest.java index 9592d46438d..9caa0c77db3 100644 --- a/server/sonar-webserver-webapi/src/test/java/org/sonar/server/webhook/ws/WebhookSupportTest.java +++ b/server/sonar-webserver-webapi/src/test/java/org/sonar/server/webhook/ws/WebhookSupportTest.java @@ -111,7 +111,7 @@ public class WebhookSupportTest { public void itThrowsIllegalExceptionIfGettingNetworkInterfaceAddressesFails() throws SocketException { when(networkInterfaceProvider.getNetworkInterfaceAddresses()).thenThrow(new SocketException()); - assertThatThrownBy(() -> underTest.checkUrlPattern("https://good-url.com", "msg")) + assertThatThrownBy(() -> underTest.checkUrlPattern("https://sonarsource.com", "msg")) .hasMessageContaining("Can not retrieve a network interfaces") .isInstanceOf(IllegalStateException.class);