HttpServletRequest request = createMock(HttpServletRequest.class);
expect(request.getHeader(OAuth.HeaderType.AUTHORIZATION))
.andStubReturn("Bearer sdfsadfsadf,oauth_signature_method=\"HMAC-SHA1\"");
replay(request);
try {
BearerHeaderOAuthValidator bov = new BearerHeaderOAuthValidator();
bov.performAllValidations(request);
Assert.fail("Exception not thrown.");
} catch (OAuthProblemException e) {
Assert.assertEquals(OAuthError.TokenResponse.INVALID_REQUEST, e.getError());
Assert.assertEquals("Incorrect OAuth version. Found OAuth V1.0.", e.getDescription());
}