use of org.springframework.security.web.authentication.switchuser.AuthenticationSwitchUserEvent in project spring-boot by spring-projects.
the class AuthenticationAuditListenerTests method testAuthenticationSwitch.
@Test
public void testAuthenticationSwitch() {
AuditApplicationEvent event = handleAuthenticationEvent(new AuthenticationSwitchUserEvent(new UsernamePasswordAuthenticationToken("user", "password"), new User("user", "password", AuthorityUtils.commaSeparatedStringToAuthorityList("USER"))));
assertThat(event.getAuditEvent().getType()).isEqualTo(AuthenticationAuditListener.AUTHENTICATION_SWITCH);
}
Aggregations