expect(request.getParameterValues(OAuth.OAUTH_BEARER_TOKEN)).andStubReturn(new String[] {"sometoken"});
expect(request.getHeader("Authorization")).andStubReturn(AUTHORIZATION_HEADER_OAUTH2);
replay(request);
OAuthAccessResourceRequest req = null;
try {
new OAuthAccessResourceRequest(request, ParameterStyle.BODY, ParameterStyle.QUERY, ParameterStyle.HEADER);
fail("Exception expeted");
} catch (OAuthProblemException e) {
Assert.assertTrue(OAuthError.TokenResponse.INVALID_REQUEST.equals(e.getError()));
}