SecurityHelper { public Set<GrantedAuthority> getUnrestrictedFunctions() { SecurityFunctionDao securityFunctionDao = ApplicationContextHolder.getApplicationContext().getBean(SecurityFunctionDao.class); Set<GrantedAuthority> authorities = new HashSet<>(); for (String function : securityFunctionDao.getUnrestrictedSecurityFunctions()) { authorities.add(new SimpleGrantedAuthority(function)); } return authorities; }  Set<GrantedAuthority> getUnrestrictedFunctions(); boolean isSecurityEnabled(HttpServletRequest request); boolean isUserGeneratedByClass(Authentication authentication, Class<?> generatedByClass); Set<GrantedAuthority> mapRolesToFunctions(Collection<String> roles);  }
@Test public void testGetUnrestrictedFunctions() { SecurityFunctionEntity securityFunctionEntity = new SecurityFunctionEntity(); securityFunctionEntity.setCode(SECURITY_FUNCTION); herdDao.saveAndRefresh(securityFunctionEntity); cacheManager.getCache(DaoSpringModuleConfig.HERD_CACHE_NAME).clear(); Set<GrantedAuthority> result = securityHelper.getUnrestrictedFunctions(); assertTrue(result.contains(new SimpleGrantedAuthority(SECURITY_FUNCTION))); }