@Test
public void shouldReturnConflictIfCompareAndSetFailsBecauseAValueMismatchExceptionIsThrown() {

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