service.validateXsrfToken((RpcToken) null);
fail("Expected RpcTokenException");
} catch (RpcTokenException e) { }
try {
RpcToken token = mock(RpcToken.class);
service.validateXsrfToken(token);
fail("Expected RpcTokenException");
} catch (RpcTokenException e) { }
try {
XsrfToken token = mock(XsrfToken.class);
when(token.getToken()).thenReturn("blech");
service.validateXsrfToken((RpcToken) token);
fail("Expected RpcTokenException");
} catch (RpcTokenException e) { }
XsrfToken token = mock(XsrfToken.class);
when(token.getToken()).thenReturn(GwtCookieXsrfTokenService.generateTokenFromCookie("value"));
service.validateXsrfToken((RpcToken) token);
}