@Test
public void shouldReturnUnhealthyResultIfCallToDistributedStoreThrowsException0() {

    // when the NOP command is made the call throws an exception immediately
    IllegalStateException failureCause = new IllegalStateException("failed");
    when(distributedStore.nop()).thenThrow(failureCause);
    assertThat(check.check().isHealthy(), equalTo(false));
    assertThat(check.check().getError(), Matchers.<Throwable>sameInstance(failureCause)); // the error returned is the actual one thrown
}