public void testApprovalDenied() throws Exception {
model.put("authorizationRequest",
getAuthorizationRequest("foo", "http://anywhere.com", null, null, Collections.singleton("code")));
Map<String, String> approvalParameters = new HashMap<String, String>();
approvalParameters.put("user_oauth_approval", "false");
View result = endpoint.approveOrDeny(approvalParameters, model, sessionStatus, principal);
String url = ((RedirectView) result).getUrl();
assertTrue("Wrong view: " + result, url.startsWith("http://anywhere.com"));
assertTrue("Wrong view: " + result, url.contains("error=access_denied"));
}