Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added tests for #250
  • Loading branch information
jannis-baratheon committed Sep 21, 2018
commit fea591b2e65d77a72eb0c67a9948e09070834356
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,32 @@ public class ClusterWaitShould {

wait.waitUntilReady(cluster);
}

@SuppressWarnings("unchecked")
@Test public void
should_propagate_throwable() throws InterruptedException {
class AThrowable extends Throwable {}

when(clusterHealthCheck.isClusterHealthy(cluster))
.thenThrow(AThrowable.class);

exception.expect(AThrowable.class);

ClusterWait wait = new ClusterWait(clusterHealthCheck, DURATION);
wait.waitUntilReady(cluster);
}

@SuppressWarnings("unchecked")
@Test public void
should_propagate_error() throws InterruptedException {
class AnError extends Error {}

when(clusterHealthCheck.isClusterHealthy(cluster))
.thenThrow(AnError.class);

exception.expect(AnError.class);

ClusterWait wait = new ClusterWait(clusterHealthCheck, DURATION);
wait.waitUntilReady(cluster);
}
}