use of org.apache.camel.component.dns.DnsConfiguration in project camel by apache.
the class DnsServiceDiscoveryTest method testServiceDiscovery.
@Test
public void testServiceDiscovery() throws Exception {
DnsConfiguration configuration = new DnsConfiguration();
DnsServiceDiscovery discovery = new DnsServiceDiscovery(configuration);
configuration.setDomain("gmail.com");
configuration.setProto("_tcp");
List<ServiceDefinition> services = discovery.getServices("_xmpp-server");
assertNotNull(services);
assertFalse(services.isEmpty());
for (ServiceDefinition service : services) {
assertFalse(service.getMetadata().isEmpty());
assertNotNull(service.getMetadata().get("priority"));
assertNotNull(service.getMetadata().get("weight"));
}
}
Aggregations