public void testValidateMethod() throws Exception {
HttpServletRequest request = createStrictMock(HttpServletRequest.class);
expect(request.getMethod()).andStubReturn(OAuth.HttpMethod.GET);
replay(request);
TokenValidator validator = new TokenValidator();
validator.validateMethod(request);
verify(request);
reset(request);
request = createStrictMock(HttpServletRequest.class);
expect(request.getMethod()).andStubReturn(OAuth.HttpMethod.POST);
replay(request);
validator = new TokenValidator();
validator.validateMethod(request);
verify(request);
reset(request);
request = createStrictMock(HttpServletRequest.class);
expect(request.getMethod()).andStubReturn(OAuth.HttpMethod.DELETE);
replay(request);
validator = new TokenValidator();
try {
validator.validateMethod(request);
Assert.fail("Expected validation exception");
} catch (OAuthProblemException e) {
//ok, expected
}