Skip to content

Commit

Permalink
Remove failing test which mocked now sealed InetAddress class (#86490)
Browse files Browse the repository at this point in the history
Fixes #86418
  • Loading branch information
slobodanadamovic committed May 9, 2022
1 parent cd721b8 commit 2a23282
Showing 1 changed file with 0 additions and 17 deletions.
Expand Up @@ -37,10 +37,6 @@
import static org.hamcrest.Matchers.equalTo;
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
Expand Down Expand Up @@ -100,19 +96,6 @@ 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);
}

public void testIssuerCertSubjectDN() throws Exception {
final ZonedDateTime notBefore = ZonedDateTime.now(ZoneOffset.UTC);
final ZonedDateTime notAfter = ZonedDateTime.parse("2099-12-31T23:23:59.999999+00:00");
Expand Down

0 comments on commit 2a23282

Please sign in to comment.