}
@Test
public void testCommenceWithOAuth2Exception() throws Exception {
request.addHeader("Accept", MediaType.APPLICATION_JSON_VALUE);
entryPoint.commence(request, response, new BadCredentialsException("Bad", new InvalidClientException(
"Bad client")));
assertEquals(HttpServletResponse.SC_UNAUTHORIZED, response.getStatus());
assertEquals("{\"error\":\"invalid_client\",\"error_description\":\"Bad client\"}", response.getContentAsString());
assertEquals(MediaType.APPLICATION_JSON_VALUE, response.getContentType());
assertEquals(null, response.getErrorMessage());