mirror of
https://github.com/google/nomulus.git
synced 2025-07-24 03:30:46 +02:00
Daggerize XsrfTokenManager
The one-day validity period is also moved from the caller into XsrfTokenManager. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=147857716
This commit is contained in:
parent
4a92d97a70
commit
0417f3d3a1
18 changed files with 112 additions and 80 deletions
|
@ -20,7 +20,9 @@ import static org.mockito.Mockito.when;
|
|||
|
||||
import com.google.appengine.api.users.UserServiceFactory;
|
||||
import com.google.common.net.MediaType;
|
||||
import google.registry.security.XsrfTokenManager;
|
||||
import google.registry.testing.AppEngineRule;
|
||||
import google.registry.testing.FakeClock;
|
||||
import google.registry.testing.FakeResponse;
|
||||
import google.registry.testing.UserInfo;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
@ -60,6 +62,7 @@ public class ConsoleUiActionTest {
|
|||
action.response = response;
|
||||
action.sessionUtils = sessionUtils;
|
||||
action.userService = UserServiceFactory.getUserService();
|
||||
action.xsrfTokenManager = new XsrfTokenManager(new FakeClock(), action.userService);
|
||||
when(sessionUtils.checkRegistrarConsoleLogin(any(HttpServletRequest.class))).thenReturn(true);
|
||||
when(sessionUtils.getRegistrarClientId(any(HttpServletRequest.class)))
|
||||
.thenReturn("TheRegistrar");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue