UnixResolverDnsServerAddressStreamProviderTest failure

Motivation:
InetSocketAddress#getHostName() may attempt a reverse lookup which may lead to test failures because the expected address will not match.

Modifications:
- Use InetSocketAddress#getHostString() which will not attempt any lookups and instead return the original String

Result:
UnixResolverDnsServerAddressStreamProviderTest is more reliable.
This commit is contained in:
Scott Mitchell 2017-07-05 13:03:29 -04:00
parent 4d51eca218
commit d040c939e5

View File

@ -111,6 +111,6 @@ public class UnixResolverDnsServerAddressStreamProviderTest {
}
private static void assertHostNameEquals(String expectedHostname, InetSocketAddress next) {
assertEquals("unexpected hostname: " + next, expectedHostname, next.getHostName());
assertEquals("unexpected hostname: " + next, expectedHostname, next.getHostString());
}
}