PodWatcher implements Supplier<CompletableFuture<Integer>>, Watcher<Pod> { @Override public CompletableFuture<Integer> get() { return exitCodeFuture; } PodWatcher(PodResource<Pod, DoneablePod> resource, String podName); @Override void onClose(KubernetesClientException cause); @Override CompletableFuture<Integer> get(); @Override void eventReceived(io.fabric8.kubernetes.client.Watcher.Action action, Pod pod);  }
@Test public void cancel_deletesResource() throws Exception { when(resource.get()).thenReturn(pod); underTest = new PodWatcher(resource, POD_NAME); underTest.get().cancel(true); verify(resource).delete(); }