@Test
public void testGetUnrestrictedFunctions()
{

    // Create a security function not mapped to any of the security roles.
    SecurityFunctionEntity securityFunctionEntity = new SecurityFunctionEntity();
    securityFunctionEntity.setCode(SECURITY_FUNCTION);
    herdDao.saveAndRefresh(securityFunctionEntity);
    // Clear the cache.
    cacheManager.getCache(DaoSpringModuleConfig.HERD_CACHE_NAME).clear();
    // Get unrestricted functions.
    Set<GrantedAuthority> result = securityHelper.getUnrestrictedFunctions();
    // Validate that result list contains the test security function.
    assertTrue(result.contains(new SimpleGrantedAuthority(SECURITY_FUNCTION)));
}