From f942bad355338816978ee0a0325893f3169fcdad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slobodan=20Adamovi=C4=87?= Date: Mon, 22 Aug 2022 14:30:37 +0200 Subject: [PATCH] Remove failing test which mocked now sealed InetAddress class (#86490) (#89503) --- .../xpack/security/cli/CertGenUtilsTests.java | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/x-pack/plugin/security/cli/src/test/java/org/elasticsearch/xpack/security/cli/CertGenUtilsTests.java b/x-pack/plugin/security/cli/src/test/java/org/elasticsearch/xpack/security/cli/CertGenUtilsTests.java index 7c9e69ad097b0..a29d2e3f3cc02 100644 --- a/x-pack/plugin/security/cli/src/test/java/org/elasticsearch/xpack/security/cli/CertGenUtilsTests.java +++ b/x-pack/plugin/security/cli/src/test/java/org/elasticsearch/xpack/security/cli/CertGenUtilsTests.java @@ -24,10 +24,6 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.notNullValue; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoMoreInteractions; -import static org.mockito.Mockito.when; /** * Unit tests for cert utils @@ -87,17 +83,4 @@ private boolean isResolvable(InetAddress inetAddress) { return hostname.equals(inetAddress.getHostAddress()) == false; } - public void testIsAnyLocalAddress() throws Exception { - InetAddress address = mock(InetAddress.class); - when(address.isAnyLocalAddress()).thenReturn(true); - - GeneralNames generalNames = CertGenUtils.getSubjectAlternativeNames(randomBoolean(), Collections.singleton(address)); - assertThat(generalNames, notNullValue()); - GeneralName[] generalNameArray = generalNames.getNames(); - assertThat(generalNameArray, notNullValue()); - - verify(address).isAnyLocalAddress(); - verifyNoMoreInteractions(address); - } - }