use of io.fabric8.kubernetes.client.WatcherException in project flink by apache.
the class KubernetesPodsWatcherTest method testClosingWithException.
@Test
public void testClosingWithException() {
final AtomicBoolean called = new AtomicBoolean(false);
final KubernetesPodsWatcher podsWatcher = new KubernetesPodsWatcher(new TestingCallbackHandler(e -> called.set(true)));
podsWatcher.onClose(new WatcherException("exception"));
assertThat(called.get(), is(true));
}
use of io.fabric8.kubernetes.client.WatcherException in project flink by apache.
the class KubernetesPodsWatcherTest method testClosingWithTooOldResourceVersion.
@Test
public void testClosingWithTooOldResourceVersion() {
final String errMsg = "too old resource version";
final KubernetesPodsWatcher podsWatcher = new KubernetesPodsWatcher(new TestingCallbackHandler(e -> {
assertThat(e, Matchers.instanceOf(KubernetesTooOldResourceVersionException.class));
assertThat(e, FlinkMatchers.containsMessage(errMsg));
}));
podsWatcher.onClose(new WatcherException(errMsg, new KubernetesClientException(errMsg, HTTP_GONE, new StatusBuilder().build())));
}
Aggregations