@Test
public void shouldReturnInternalServerErrorIfCompareAndSetFailsBecauseAnExceptionIsThrownInServiceCode() {

    when(distributedStore.compareAndSet(KEY, casValue)).thenThrow(new IllegalStateException("service code terminated unexpectedly"));
    assertThatValidCompareAndSetRequestReturnsErrorStatus(ClientResponse.Status.INTERNAL_SERVER_ERROR);
}