assertEquals(GwtCookieXsrfTokenService.generateTokenFromCookie("value"), service.generateXsrfToken());
}
/** Test validateXsrfToken() for an RpcToken. */
@Test public void testValidateXsrfTokenRpcToken() {
ISpringContextService springContextService = mock(ISpringContextService.class);
GwtCookieXsrfTokenService service = new GwtCookieXsrfTokenService();
service.setSessionCookieName("cookie");
service.setSpringContextService(springContextService);
Cookie cookie = mock(Cookie.class);
when(cookie.getValue()).thenReturn("value");
when(springContextService.getCookie("cookie", false)).thenReturn(cookie);
try {
service.validateXsrfToken((RpcToken) null);
fail("Expected RpcTokenException");
} catch (RpcTokenException e) { }