use of io.servicetalk.dns.discovery.netty.DnsServiceDiscovererObserver.ResolutionResult in project servicetalk by apple.
the class DnsServiceDiscovererObserverTest method aQueryResolutionResult.
private void aQueryResolutionResult(ResultsVerifier<BlockingQueue<ResolutionResult>> verifier) throws Exception {
BlockingQueue<ResolutionResult> results = new LinkedBlockingDeque<>();
DnsClient client = dnsClient(__ -> name -> new NoopDnsResolutionObserver() {
@Override
public void resolutionCompleted(final ResolutionResult result) {
results.add(result);
}
});
assertThat("Unexpected calls to resolutionCompleted", results, hasSize(0));
Cancellable discovery = client.dnsQuery(HOST_NAME).forEach(__ -> {
});
try {
verifier.verify(results);
} finally {
discovery.cancel();
}
}
Aggregations