.error(OAuthError.CodeResponse.ACCESS_DENIED, "Access denied")
.setParameter("testparameter", "testparameter_value")
.scope("album")
.uri("http://www.example.com/error");
OAuthResponse oAuthResponse = OAuthResponse.errorResponse(400).error(ex).buildJSONMessage();
Assert.assertEquals(
"{\"error_uri\":\"http:\\/\\/www.example.com\\/error\",\"error\":\"access_denied\",\""
+ "error_description\":\"Access denied\"}",
oAuthResponse.getBody());
oAuthResponse = OAuthResponse.errorResponse(500)
.location("http://www.example.com/redirect?param2=true").error(ex).buildQueryMessage();
Assert.assertEquals(
"http://www.example.com/redirect?param2=true&error_uri=http%3A%2F%2Fwww.example.com%2Ferror"
+ "&error=access_denied&error_description=Access+denied",
oAuthResponse.getLocationUri());
}