use of com.sun.identity.sm.OrganizationConfigManager in project OpenAM by OpenRock.
the class OrgAliasReferralTest method createOrgs.
private void createOrgs() throws Exception {
OrganizationConfigManager ocm = new OrganizationConfigManager(adminToken, "/");
String subRealm = SUB_REALM1.substring(1);
Map<String, Map<String, Set<String>>> map = new HashMap<String, Map<String, Set<String>>>();
Map<String, Set<String>> idRepoService = new HashMap<String, Set<String>>();
Set<String> set = new HashSet<String>();
set.add("www.OrgAliasReferralTest.com");
idRepoService.put(PolicyManager.ORG_ALIAS, set);
map.put(PolicyManager.ID_REPO_SERVICE, idRepoService);
ocm.createSubOrganization(subRealm, map);
}
use of com.sun.identity.sm.OrganizationConfigManager in project OpenAM by OpenRock.
the class ReferralPrivilegeTest method cleanup.
@AfterClass
public void cleanup() throws Exception {
if (!migrated) {
return;
}
IdRepoUtils.deleteIdentity("/", user);
OrganizationConfigManager ocm = new OrganizationConfigManager(adminToken, "/");
ocm.deleteSubOrganization(SUB_REALM1.substring(1), true);
ocm.deleteSubOrganization(SUB_REALM2.substring(1), true);
}
use of com.sun.identity.sm.OrganizationConfigManager in project OpenAM by OpenRock.
the class ReferralPrivilegeWithRemovedRealmTest method setup.
@BeforeClass
public void setup() throws Exception {
if (!migrated) {
return;
}
OrganizationConfigManager ocm = new OrganizationConfigManager(adminToken, "/");
String subRealm = SUB_REALM.substring(1);
ocm.createSubOrganization(subRealm, Collections.EMPTY_MAP);
createReferral();
}
use of com.sun.identity.sm.OrganizationConfigManager in project OpenAM by OpenRock.
the class ReferralPrivilegeWithRemovedRealmTest method test.
@Test
public void test() throws Exception {
if (!migrated) {
return;
}
OrganizationConfigManager ocm = new OrganizationConfigManager(adminToken, "/");
String subRealm = SUB_REALM.substring(1);
ocm.deleteSubOrganization(subRealm, true);
Evaluator evaluator = new Evaluator(adminSubject, ApplicationTypeManager.URL_APPLICATION_TYPE_NAME);
Set actions = new HashSet();
actions.add("GET");
//should not result in NPE.
evaluator.hasEntitlement("/", adminSubject, new Entitlement("http://www.ReferralPrivilegeWithRemovedRealmTest.com/index.html", actions), Collections.EMPTY_MAP);
}
use of com.sun.identity.sm.OrganizationConfigManager in project OpenAM by OpenRock.
the class ReferredResourcesTest method createOrgs.
private void createOrgs() throws Exception {
OrganizationConfigManager ocm = new OrganizationConfigManager(adminToken, "/");
String subRealm = SUB_REALM1.substring(1);
Map<String, Map<String, Set<String>>> map = new HashMap<String, Map<String, Set<String>>>();
Map<String, Set<String>> idRepoService = new HashMap<String, Set<String>>();
Set<String> set = new HashSet<String>();
set.add("a.com");
idRepoService.put(PolicyManager.ORG_ALIAS, set);
map.put(PolicyManager.ID_REPO_SERVICE, idRepoService);
ocm.createSubOrganization(subRealm, map);
subRealm = SUB_REALM2.substring(1);
ocm.createSubOrganization(subRealm, Collections.EMPTY_MAP);
subRealm = SUB_REALM3.substring(1);
ocm.createSubOrganization(subRealm, Collections.EMPTY_MAP);
}
Aggregations