@Test
public void creatErrorShouldCreateErrorResponse() {

    Response errorResponse = JSONResponse.createErrorResponse(Status.INTERNAL_SERVER_ERROR, "error");
    assertThat(errorResponse.getMediaType(), is(equalTo(MediaType.APPLICATION_JSON_TYPE)));
    assertThat(errorResponse.getStatus(), is(500));
    JsonObject entity = ((JsonObject) errorResponse.getEntity()).get(JSONResponse.JSON_KEY_ERROR).getAsJsonObject();
    assertThat(entity.get(JSONResponse.JSON_KEY_ERROR_MESSAGE).getAsString(), is("error"));
    assertThat(entity.get(JSONResponse.JSON_KEY_HTTPCODE).getAsInt(), is(500));
}