### Question:
Response { public static HttpResponse createOAuthExceptionResponse(OAuthException ex) { return createResponse(ex.getHttpStatus(), ex.getMessage()); }  static HttpResponse createBadRequestResponse(); static HttpResponse createBadRequestResponse(String message); static HttpResponse createNotFoundResponse(); static HttpResponse createOkResponse(String jsonString); static HttpResponse createOAuthExceptionResponse(OAuthException ex); static HttpResponse createUnauthorizedResponse(); static HttpResponse createResponse(HttpResponseStatus status, String message); static final String CANNOT_REGISTER_APP; static final String NAME_OR_SCOPE_OR_URI_IS_NULL; static final String SCOPE_NOT_EXIST; static final String INVALID_CLIENT_ID; static final String INVALID_CLIENT_CREDENTIALS; static final String RESPONSE_TYPE_NOT_SUPPORTED; static final String INVALID_REDIRECT_URI; static final String MANDATORY_PARAM_MISSING; static final String CANNOT_ISSUE_TOKEN; static final String INVALID_AUTH_CODE; static final String GRANT_TYPE_NOT_SUPPORTED; static final String INVALID_ACCESS_TOKEN; static final String INVALID_REFRESH_TOKEN; static final String INVALID_USERNAME_PASSWORD; static final String CANNOT_AUTHENTICATE_USER; static final String NOT_FOUND_CONTENT; static final String UNSUPPORTED_MEDIA_TYPE; static final String CANNOT_UPDATE_APP; static final String UPDATE_APP_MANDATORY_PARAM_MISSING; static final String ALREADY_REGISTERED_APP; static final String CLIENT_APP_NOT_EXIST; static final String SCOPE_NOK_MESSAGE; static final String CLIENT_APP_UPDATED; static final String CANNOT_LIST_CLIENT_APPS; static final String INVALID_JSON_ERROR; static final String ERROR_NOT_INTEGER; static final String APPLICATION_JSON; }### Answer:
@Test public void when_get_exception_response_get_exception_HTTP_status() throws Exception { OAuthException ex = mock(OAuthException.class); willReturn(Response.NAME_OR_SCOPE_OR_URI_IS_NULL).given(ex).getMessage(); willReturn(HttpResponseStatus.BAD_REQUEST).given(ex).getHttpStatus(); HttpResponse response = Response.createOAuthExceptionResponse(ex); assertEquals(response.getStatus(), HttpResponseStatus.BAD_REQUEST); assertEquals(response.headers().get(HttpHeaders.Names.CACHE_CONTROL), HttpHeaders.Values.NO_STORE); assertEquals(response.headers().get(HttpHeaders.Names.PRAGMA), HttpHeaders.Values.NO_CACHE); assertEquals(response.headers().get(HttpHeaders.Names.CONTENT_LENGTH), String.valueOf(Response.NAME_OR_SCOPE_OR_URI_IS_NULL.getBytes().length)); assertEquals(response.headers().get(HttpHeaders.Names.CONTENT_TYPE), "application/json"); verify(ex).getMessage(); }