mirror of
https://github.com/google/nomulus.git
synced 2025-05-17 09:57:17 +02:00
Refactor a few new XsrfTokenManager methods
Followup to comments on [] ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=148792464
This commit is contained in:
parent
822cbc0494
commit
726e925b4a
5 changed files with 28 additions and 61 deletions
|
@ -220,7 +220,7 @@ public class RequestAuthenticatorTest {
|
|||
public void testAnyUserAnyMethod_success() throws Exception {
|
||||
fakeUserService.setUser(testUser, false /* isAdmin */);
|
||||
when(req.getHeader(XsrfTokenManager.X_CSRF_TOKEN))
|
||||
.thenReturn(xsrfTokenManager.generateTokenWithCurrentUser("console"));
|
||||
.thenReturn(xsrfTokenManager.generateToken("console", testUser.getEmail()));
|
||||
|
||||
Optional<AuthResult> authResult = runTest(fakeUserService, AuthAnyUserAnyMethod.class);
|
||||
|
||||
|
@ -275,7 +275,7 @@ public class RequestAuthenticatorTest {
|
|||
public void testAdminUserAnyMethod_success() throws Exception {
|
||||
fakeUserService.setUser(testUser, true /* isAdmin */);
|
||||
when(req.getHeader(XsrfTokenManager.X_CSRF_TOKEN))
|
||||
.thenReturn(xsrfTokenManager.generateTokenWithCurrentUser("console"));
|
||||
.thenReturn(xsrfTokenManager.generateToken("console", testUser.getEmail()));
|
||||
|
||||
Optional<AuthResult> authResult = runTest(fakeUserService, AuthAdminUserAnyMethod.class);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue