Add method to return both IP and port for SRV DNS lookup requests
Closes gh-9030
This commit is contained in:
committed by
Eleftheria Stein
parent
fa77f4c8ff
commit
2af322c06d
@@ -95,6 +95,16 @@ public class JndiDnsResolverTests {
|
||||
assertThat(ipAddress).isEqualTo("63.246.7.80");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void resolveServiceIpAddressWithPort() throws Exception {
|
||||
BasicAttributes srvRecords = createSrvRecords();
|
||||
BasicAttributes aRecords = new BasicAttributes("A", "63.246.7.80");
|
||||
given(this.context.getAttributes("_ldap._tcp.springsource.com", new String[] { "SRV" })).willReturn(srvRecords);
|
||||
given(this.context.getAttributes("kdc.springsource.com", new String[] { "A" })).willReturn(aRecords);
|
||||
String ipAddress = this.dnsResolver.resolveServiceIpAddressAndPort("ldap", "springsource.com");
|
||||
assertThat(ipAddress).isEqualTo("63.246.7.80:389");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnknowError() throws Exception {
|
||||
given(this.context.getAttributes(any(String.class), any(String[].class)))
|
||||
|
||||
Reference in New Issue
Block a user