HttpServletRequest request = createMock(HttpServletRequest.class);
expect(request.getMethod()).andStubReturn("GET");
expect(request.getContentType()).andStubReturn(OAuth.ContentType.URL_ENCODED);
replay(request);
try {
BearerBodyOAuthValidator bov = new BearerBodyOAuthValidator();
bov.performAllValidations(request);
Assert.fail("Exception not thrown.");
} catch (OAuthProblemException e) {
Assert.assertEquals(OAuthError.TokenResponse.INVALID_REQUEST, e.getError());
Assert.assertEquals("Incorrect method. POST, PUT, DELETE are supported.", e.getDescription());
}