@Test
public void shouldReturnInternalServerErrorIfCompareAndSetFailsBecauseADatabaseExceptionIsThrownInsideDistributedStore() {

    when(distributedStore.compareAndSet(KEY, casValue)).thenReturn(Futures.<KeyValue>immediateFailedFuture(new StorageException(new SQLException("DATABASE GONE"))));
    assertThatValidCompareAndSetRequestReturnsErrorStatus(ClientResponse.Status.INTERNAL_SERVER_ERROR);
}