@Test public void clearAuthentication_ShouldRemoveAuthenticationFromSecurityContext() { Authentication authentication = createAuthentication(); SecurityContextHolder.getContext().setAuthentication(authentication); AuthenticationUtil.clearAuthentication(); Authentication currentAuthentication = SecurityContextHolder.getContext().getAuthentication(); assertThat(currentAuthentication).isNull(); }
public static void clearAuthentication() { SecurityContextHolder.getContext().setAuthentication(null); }
AuthenticationUtil { public static void clearAuthentication() { SecurityContextHolder.getContext().setAuthentication(null); } }
AuthenticationUtil { public static void clearAuthentication() { SecurityContextHolder.getContext().setAuthentication(null); } private  AuthenticationUtil(); }
AuthenticationUtil { public static void clearAuthentication() { SecurityContextHolder.getContext().setAuthentication(null); } private  AuthenticationUtil(); static void clearAuthentication(); static void configureAuthentication(String role); }
AuthenticationUtil { public static void clearAuthentication() { SecurityContextHolder.getContext().setAuthentication(null); } private  AuthenticationUtil(); static void clearAuthentication(); static void configureAuthentication(String role);  }