private MockHttpServletResponse response = new MockHttpServletResponse();
@Test
public void testErrorPage() throws Exception {
request.setContextPath("/foo");
request.setAttribute("error", new InvalidClientException("FOO"));
ModelAndView result = endpoint.handleError(request);
result.getView().render(result.getModel(), request , response);
String content = response.getContentAsString();
assertTrue("Wrong content: " + content, content.contains("OAuth Error"));
assertTrue("Wrong content: " + content, content.contains("invalid_client"));