@Test
public void shouldReturnBadRequestIfSetFailsBecauseNewValueIsNull() {

    when(distributedStore.set(KEY, setValue)).thenReturn(Futures.<KeyValue>immediateFailedFuture(new StorageException(new SQLException("DATABASE GONE"))));
    SetValue nulledValue = new SetValue();
    nulledValue.setNewValue(null);
    assertThatResourceMethodReturnsStatus(
            client().resource(REQUEST_URI).type(MediaType.APPLICATION_JSON_TYPE).entity(nulledValue),
            "PUT",
            ClientResponse.Status.BAD_REQUEST);
}