use of io.confluent.ksql.rest.util.DiscoverRemoteHostsUtil in project ksql by confluentinc.
the class RemoteHostExecutorTest method testReturnsHostsThatHaveThrownAnException.
@Test
public void testReturnsHostsThatHaveThrownAnException() {
when(ksqlClient.makeKsqlRequest(any(), any(), any())).thenThrow(new KsqlRestClientException("error"));
try (MockedStatic<DiscoverRemoteHostsUtil> hdu = mockStatic(DiscoverRemoteHostsUtil.class)) {
hdu.when(() -> DiscoverRemoteHostsUtil.getRemoteHosts(any(), any())).thenReturn(hosts);
Pair<Map<HostInfo, KsqlEntity>, Set<HostInfo>> remoteResults = augmenter.fetchAllRemoteResults();
assertEquals(hosts, remoteResults.getRight());
assertThat(remoteResults.getLeft().entrySet(), hasSize(0));
}
}
Aggregations