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
  • Loading branch information
slobodanadamovic committed Aug 22, 2022
1 parent 6b30159 commit f942bad
Showing 1 changed file with 0 additions and 17 deletions.
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}

}

0 comments on commit f942bad

Please sign in to comment.