@Override public SecurityRoleKeys getSecurityRoles() { // Get and return all the security role keys. SecurityRoleKeys securityRoleKeys = new SecurityRoleKeys(); securityRoleKeys.getSecurityRoleKeys().addAll(securityRoleDao.getSecurityRoleKeys()); return securityRoleKeys; }
@Override public SecurityRoleKeys getSecurityRoles() { // Get and return all the security role keys. SecurityRoleKeys securityRoleKeys = new SecurityRoleKeys(); securityRoleKeys.getSecurityRoleKeys().addAll(securityRoleDao.getSecurityRoleKeys()); return securityRoleKeys; }
@Test public void testGetSecurityRoleKeys() { // Create a list of security role keys. final List<SecurityRoleKey> securityRoleKeys = ImmutableList.of(new SecurityRoleKey(SECURITY_ROLE), new SecurityRoleKey(SECURITY_ROLE_2)); // Create and persist security role entities in reverse order. for (SecurityRoleKey securityRoleKey : Lists.reverse(securityRoleKeys)) { securityRoleDaoTestHelper.createSecurityRoleEntity(securityRoleKey.getSecurityRoleName()); } // Get all security roles registered in the system. List<SecurityRoleKey> result = securityRoleDao.getSecurityRoleKeys(); // Validate the returned object. assertEquals(securityRoleKeys, result); } }