public static HttpErrorResponse badRequest(String msg) {
        return new HttpErrorResponse(BAD_REQUEST, ErrorCode.BAD_REQUEST.name(), msg);
    }
@Test
    public void testThatHttpErrorResponseIsRenderedAsJson() throws IOException {
        HttpErrorResponse response = HttpErrorResponse.badRequest("Error doing something");
        assertThat(response.getJdiscResponse().getStatus(), is(BAD_REQUEST));
        assertThat(SessionHandlerTest.getRenderedString(response), is("{\"error-code\":\"BAD_REQUEST\",\"message\":\"Error doing something\"}"));
    }