verify(resp).sendError(eq(HttpServletResponse.SC_UNAUTHORIZED), anyString());
}
public void testDoPostUnauthorizedWhenValidationFails() throws Exception {
doThrow(new OAuthException("")).when(validator).validateMessage(
any(OAuthMessage.class), any(OAuthAccessor.class));
Map<String, String[]> params = getOAuthParams();
when(req.getParameterMap()).thenReturn(params);
servlet.doPost(req, resp);