Polish "Publish an AuditEvent on logout"

See gh-41278
This commit is contained in:
Moritz Halbritter 2024-07-03 10:40:59 +02:00
parent c5953feae6
commit 0ce3420fcb
2 changed files with 2 additions and 4 deletions

View File

@ -53,8 +53,7 @@ public class AuthenticationAuditListener extends AbstractAuthenticationAuditList
public static final String AUTHENTICATION_SWITCH = "AUTHENTICATION_SWITCH";
/**
* This constant is used to indicate that the logout process
* has been completed successfully.
* Logout success event type.
*
* @since 3.4.0
*/
@ -111,7 +110,6 @@ public class AuthenticationAuditListener extends AbstractAuthenticationAuditList
data.put("details", event.getAuthentication().getDetails());
}
publish(new AuditEvent(event.getAuthentication().getName(), LOGOUT_SUCCESS, data));
}
private static final class WebAuditListener {

View File

@ -62,7 +62,7 @@ class AuthenticationAuditListenerTests {
}
@Test
void testLogoutSucess() {
void testLogoutSuccess() {
AuditApplicationEvent event = handleAuthenticationEvent(
new LogoutSuccessEvent(new UsernamePasswordAuthenticationToken("user", "password")));
assertThat(event.getAuditEvent().getType()).isEqualTo(AuthenticationAuditListener.LOGOUT_SUCCESS);