Search in sources :

Example 1 with EntitlementPolicyServiceClient

use of org.wso2.identity.integration.common.clients.entitlement.EntitlementPolicyServiceClient in project product-is by wso2.

the class ApplicationAuthzTestCase method testInit.

@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init(TestUserMode.SUPER_TENANT_ADMIN);
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
    applicationManagementServiceClient = new ApplicationManagementServiceClient(sessionCookie, backendURL, configContext);
    ssoConfigServiceClient = new SAMLSSOConfigServiceClient(backendURL, sessionCookie);
    remoteUSMServiceClient = new RemoteUserStoreManagerServiceClient(backendURL, sessionCookie);
    entitlementPolicyClient = new EntitlementPolicyServiceClient(backendURL, sessionCookie);
    httpClientAzUser = HttpClientBuilder.create().setDefaultCookieStore(new BasicCookieStore()).build();
    httpClientNonAzUser = HttpClientBuilder.create().setDefaultCookieStore(new BasicCookieStore()).build();
    createRole(AZ_TEST_ROLE);
    createUser(AZ_TEST_USER, AZ_TEST_USER_PW, new String[] { AZ_TEST_ROLE });
    userId = UserUtil.getUserId(MultitenantUtils.getTenantAwareUsername(AZ_TEST_USER), isServer.getContextTenant());
    createUser(NON_AZ_TEST_USER, NON_AZ_TEST_USER_PW, new String[0]);
    createApplication(APPLICATION_NAME);
    createSAMLApp(APPLICATION_NAME, true, true, true);
    setupXACMLPolicy(POLICY_ID, POLICY);
}
Also used : ConfigurationContext(org.apache.axis2.context.ConfigurationContext) BasicCookieStore(org.apache.http.impl.client.BasicCookieStore) ApplicationManagementServiceClient(org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient) SAMLSSOConfigServiceClient(org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient) RemoteUserStoreManagerServiceClient(org.wso2.identity.integration.common.clients.usermgt.remote.RemoteUserStoreManagerServiceClient) EntitlementPolicyServiceClient(org.wso2.identity.integration.common.clients.entitlement.EntitlementPolicyServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 2 with EntitlementPolicyServiceClient

use of org.wso2.identity.integration.common.clients.entitlement.EntitlementPolicyServiceClient in project product-is by wso2.

the class EntitlementPIPAttributeCacheTestCase method destroy.

@AfterClass(alwaysRun = true)
public void destroy() throws Exception {
    // Remove added policy
    entitlementPolicyClient = new EntitlementPolicyServiceClient(backendURL, sessionCookie);
    entitlementPolicyClient.enableDisablePolicy(POLICY_ID, false);
    entitlementPolicyClient.removePolicy(POLICY_ID);
    // Copy default config file
    File srcConfigFile = new File(getISResourceLocation() + File.separator + "entitlement" + File.separator + "config" + File.separator + "entitlement_default.properties");
    File targetConfigFile = new File(Utils.getResidentCarbonHome() + File.separator + "repository" + File.separator + "conf" + File.separator + "identity" + File.separator + "entitlement.properties");
    scm.applyConfigurationWithoutRestart(srcConfigFile, targetConfigFile, true);
    // remove custom attribute finder from lib
    scm.removeFromComponentLib("org.wso2.carbon.identity.custom.pip-4.2.2.jar");
    scm.restartGracefully();
}
Also used : File(java.io.File) EntitlementPolicyServiceClient(org.wso2.identity.integration.common.clients.entitlement.EntitlementPolicyServiceClient) AfterClass(org.testng.annotations.AfterClass)

Example 3 with EntitlementPolicyServiceClient

use of org.wso2.identity.integration.common.clients.entitlement.EntitlementPolicyServiceClient in project product-is by wso2.

the class EntitlementPIPAttributeCacheTestCase method testInit.

@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init();
    scm = new ServerConfigurationManager(isServer);
    entitlementPolicyClient = new EntitlementPolicyServiceClient(backendURL, sessionCookie);
    addPolicy();
    addCustomAttributeFinder();
    // call super init since server restart happens in previous step
    super.init();
    entitlementServiceClient = new EntitlementServiceClient(backendURL, sessionCookie);
}
Also used : EntitlementServiceClient(org.wso2.identity.integration.common.clients.entitlement.EntitlementServiceClient) ServerConfigurationManager(org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager) EntitlementPolicyServiceClient(org.wso2.identity.integration.common.clients.entitlement.EntitlementPolicyServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 4 with EntitlementPolicyServiceClient

use of org.wso2.identity.integration.common.clients.entitlement.EntitlementPolicyServiceClient in project product-is by wso2.

the class EntitlementRestServiceTestCase method testInit.

@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init();
    entitlementPolicyClient = new EntitlementPolicyServiceClient(backendURL, sessionCookie);
    httpClient = HttpClientBuilder.create().build();
    serverPort = isServer.getDefaultInstance().getPorts().get("https");
    username = isServer.getContextTenant().getContextUser().getUserName();
    password = isServer.getContextTenant().getContextUser().getPassword();
}
Also used : EntitlementPolicyServiceClient(org.wso2.identity.integration.common.clients.entitlement.EntitlementPolicyServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 5 with EntitlementPolicyServiceClient

use of org.wso2.identity.integration.common.clients.entitlement.EntitlementPolicyServiceClient in project product-is by wso2.

the class EntitlementJSONSupportMultiDecisionProfileTestCase method testInit.

@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init();
    entitlementPolicyClient = new EntitlementPolicyServiceClient(backendURL, sessionCookie);
    remoteUserStoreManagerServiceClient = new RemoteUserStoreManagerServiceClient(backendURL, sessionCookie);
    PolicyDTO policy = new PolicyDTO();
    policy.setPolicy(POLICY);
    entitlementPolicyClient.addPolicy(policy);
    entitlementPolicyClient.publishPolicies(new String[] { POLICY_ID }, new String[] { "PDP Subscriber" }, "CREATE", true, null, 1);
    remoteUserStoreManagerServiceClient.addUser("adminUser", PASSWORD, new String[] { ROLE }, null, "adminUser", false);
    remoteUserStoreManagerServiceClient.addUser("publicUser", PASSWORD, new String[] { ROLE }, null, "publicUser", false);
    remoteUserStoreManagerServiceClient.addUser("localUser", PASSWORD, new String[] { ROLE }, null, "localUser", false);
}
Also used : PolicyDTO(org.wso2.carbon.identity.entitlement.stub.dto.PolicyDTO) RemoteUserStoreManagerServiceClient(org.wso2.identity.integration.common.clients.usermgt.remote.RemoteUserStoreManagerServiceClient) EntitlementPolicyServiceClient(org.wso2.identity.integration.common.clients.entitlement.EntitlementPolicyServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

EntitlementPolicyServiceClient (org.wso2.identity.integration.common.clients.entitlement.EntitlementPolicyServiceClient)11 BeforeClass (org.testng.annotations.BeforeClass)9 RemoteUserStoreManagerServiceClient (org.wso2.identity.integration.common.clients.usermgt.remote.RemoteUserStoreManagerServiceClient)4 ConfigurationContext (org.apache.axis2.context.ConfigurationContext)2 BasicCookieStore (org.apache.http.impl.client.BasicCookieStore)2 AfterClass (org.testng.annotations.AfterClass)2 ApplicationManagementServiceClient (org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient)2 EntitlementServiceClient (org.wso2.identity.integration.common.clients.entitlement.EntitlementServiceClient)2 SAMLSSOConfigServiceClient (org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient)2 File (java.io.File)1 PolicyDTO (org.wso2.carbon.identity.entitlement.stub.dto.PolicyDTO)1 ServerConfigurationManager (org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager)1 UserManagementClient (org.wso2.identity.integration.common.clients.UserManagementClient)1 UserProfileMgtServiceClient (org.wso2.identity.integration.common.clients.UserProfileMgtServiceClient)1