Search in sources :

Example 1 with ResourceTypeConfiguration

use of org.forgerock.openam.entitlement.configuration.ResourceTypeConfiguration in project OpenAM by OpenRock.

the class UpgradeEntitlementSubConfigsStepTest method setUp.

@BeforeMethod
public void setUp() throws IllegalAccessException, InstantiationException {
    mockTypes = new HashSet<ApplicationType>(3);
    final ApplicationType type1 = newType("type1");
    final ApplicationType type2 = newType("type2");
    final ApplicationType type3 = newType("type3");
    mockTypes.addAll(Arrays.asList(type1, type2, type3));
    this.type1 = type1;
    mockApplications = new HashSet<Application>(3);
    final Application application1 = newApplication("application1", type1);
    final Application application2 = newApplication("application2", type1);
    final Application application3 = newApplication("application3", type1);
    mockApplications.addAll(Arrays.asList(application1, application2, application3));
    entitlementService = mock(EntitlementConfiguration.class);
    adminTokenAction = mock(PrivilegedAction.class);
    connectionFactory = mock(ConnectionFactory.class);
    resourceTypeConfiguration = mock(ResourceTypeConfiguration.class);
    upgradeStep = new SafeUpgradeEntitlementSubConfigsStep(entitlementService, resourceTypeConfiguration, adminTokenAction, connectionFactory);
    final HashSet<String> conditions = new HashSet<String>();
    conditions.add("condition.entry.1");
    conditions.add("condition.entry.2");
    final HashSet<String> subjects = new HashSet<String>();
    subjects.add("subject.entry.1");
    subjects.add("subject.entry.2");
    final HashSet<String> resources = new HashSet<String>();
    resources.add("http://*");
    resources.add("https://*");
    app = newApplication("application4", type1);
    app.setConditions(conditions);
    app.setSubjects(subjects);
    app.setEntitlementCombinerName(DEFAULT_COMBINER);
}
Also used : ApplicationType(com.sun.identity.entitlement.ApplicationType) ConnectionFactory(org.forgerock.openam.sm.datalayer.api.ConnectionFactory) PrivilegedAction(java.security.PrivilegedAction) EntitlementConfiguration(com.sun.identity.entitlement.EntitlementConfiguration) ResourceTypeConfiguration(org.forgerock.openam.entitlement.configuration.ResourceTypeConfiguration) Application(com.sun.identity.entitlement.Application) HashSet(java.util.HashSet) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

Application (com.sun.identity.entitlement.Application)1 ApplicationType (com.sun.identity.entitlement.ApplicationType)1 EntitlementConfiguration (com.sun.identity.entitlement.EntitlementConfiguration)1 PrivilegedAction (java.security.PrivilegedAction)1 HashSet (java.util.HashSet)1 ResourceTypeConfiguration (org.forgerock.openam.entitlement.configuration.ResourceTypeConfiguration)1 ConnectionFactory (org.forgerock.openam.sm.datalayer.api.ConnectionFactory)1 BeforeMethod (org.testng.annotations.BeforeMethod)1