@Test @WithMockUserContext(userName = TEST_USER_NAME) public void testGetUserContext() { UserContext context = authManager.getUserContext(); Assert.assertNotNull(context); Assert.assertEquals(TEST_USER_NAME, context.getUsername()); }
public UserContext getUserContext() { Object principal = getPrincipal(); if (principal instanceof UserContext) { return (UserContext)principal; } else { return null; } }
AuthManager { public UserContext getUserContext() { Object principal = getPrincipal(); if (principal instanceof UserContext) { return (UserContext)principal; } else { return null; } } }
AuthManager { public UserContext getUserContext() { Object principal = getPrincipal(); if (principal instanceof UserContext) { return (UserContext)principal; } else { return null; } } @Autowired  AuthManager(JwtTokenGenerator jwtTokenGenerator); }
AuthManager { public UserContext getUserContext() { Object principal = getPrincipal(); if (principal instanceof UserContext) { return (UserContext)principal; } else { return null; } } @Autowired  AuthManager(JwtTokenGenerator jwtTokenGenerator); UserContext getUserContext(); String getAuthorizedUser(); JwtRawToken issueTokenForCurrentUser(Long expiration); }
AuthManager { public UserContext getUserContext() { Object principal = getPrincipal(); if (principal instanceof UserContext) { return (UserContext)principal; } else { return null; } } @Autowired  AuthManager(JwtTokenGenerator jwtTokenGenerator); UserContext getUserContext(); String getAuthorizedUser(); JwtRawToken issueTokenForCurrentUser(Long expiration); static final String UNAUTHORIZED_USER; }