@Test
public void shouldReturnNotFoundIfCompareAndSetFailsBecauseAKeyNotFoundExceptionIsThrown() {

    when(distributedStore.compareAndSet(KEY, casValue)).thenReturn(Futures.<KeyValue>immediateFailedFuture(new KeyNotFoundException(KEY)));
    assertThatResourceMethodReturnsStatus(
            client().resource(REQUEST_URI).type(MediaType.APPLICATION_JSON_TYPE).entity(casValue),
            "PUT",
            ClientResponse.Status.NOT_FOUND
    );
}