@Test void currentUserIsAuthenticated_false() { when(authentication.isAuthenticated()).thenReturn(false); assertFalse(SecurityUtils.currentUserIsAuthenticated()); }
public static boolean currentUserIsAuthenticated() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); return authentication != null && authentication.isAuthenticated() && !currentUserIsAnonymous(); }
SecurityUtils { public static boolean currentUserIsAuthenticated() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); return authentication != null && authentication.isAuthenticated() && !currentUserIsAnonymous(); } }
SecurityUtils { public static boolean currentUserIsAuthenticated() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); return authentication != null && authentication.isAuthenticated() && !currentUserIsAnonymous(); } private  SecurityUtils(); }
SecurityUtils { public static boolean currentUserIsAuthenticated() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); return authentication != null && authentication.isAuthenticated() && !currentUserIsAnonymous(); } private  SecurityUtils(); static @Nullable @CheckForNull String getCurrentUsername(); static boolean currentUserHasRole(String... roles); static boolean currentUserIsSuOrSystem(); static boolean currentUserIsSu(); static boolean currentUserIsSystem(); static boolean currentUserIsAuthenticated(); static boolean currentUserIsAnonymous(); }
SecurityUtils { public static boolean currentUserIsAuthenticated() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); return authentication != null && authentication.isAuthenticated() && !currentUserIsAnonymous(); } private  SecurityUtils(); static @Nullable @CheckForNull String getCurrentUsername(); static boolean currentUserHasRole(String... roles); static boolean currentUserIsSuOrSystem(); static boolean currentUserIsSu(); static boolean currentUserIsSystem(); static boolean currentUserIsAuthenticated(); static boolean currentUserIsAnonymous(); static final String ANONYMOUS_USERNAME; static final String AUTHORITY_SU; static final String AUTHORITY_ANONYMOUS; static final String AUTHORITY_USER; static final String ROLE_SYSTEM; static final String ROLE_ACL_TAKE_OWNERSHIP; static final String ROLE_ACL_MODIFY_AUDITING; static final String ROLE_ACL_GENERAL_CHANGES; }