Search in sources :

Example 26 with UserManagementClient

use of org.wso2.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.

the class ManageInternalRolesWithPermissionTestCase method testInit.

@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init();
    loginAndObtainSessionCookie();
    userManagementClient = new UserManagementClient(backendServiceURL, sessionCookie);
}
Also used : UserManagementClient(org.wso2.identity.scenarios.commons.clients.UserManagementClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 27 with UserManagementClient

use of org.wso2.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.

the class ProvisioningTestCase method createServiceClientsForServers.

private void createServiceClientsForServers(String sessionCookie, int portOffset, CommonConstants.AdminClients[] adminClients) throws Exception {
    if (adminClients == null) {
        return;
    }
    // TODO: Need to remove getSecureServiceUrl method when server start issue got fixed / TAF 4.3.1
    String serviceUrl = getSecureServiceUrl(portOffset, automationContextMap.get(portOffset).getContextUrls().getSecureServiceUrl());
    if (sessionCookie == null) {
        AuthenticatorClient authenticatorClient = new AuthenticatorClient(serviceUrl);
        sessionCookie = authenticatorClient.login(automationContextMap.get(portOffset).getSuperTenant().getTenantAdmin().getUserName(), automationContextMap.get(portOffset).getSuperTenant().getTenantAdmin().getPassword(), automationContextMap.get(portOffset).getDefaultInstance().getHosts().get("default"));
        if (sessionCookie == null) {
            throw new Exception("Unable to login to the server instance : " + automationContextMap.get(portOffset).getInstance().getName());
        }
    }
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
    for (CommonConstants.AdminClients client : adminClients) {
        if (CommonConstants.AdminClients.APPLICATION_MANAGEMENT_SERVICE_CLIENT.equals(client)) {
            applicationManagementServiceClients.put(portOffset, new ApplicationManagementServiceClient(sessionCookie, serviceUrl, configContext));
        } else if (CommonConstants.AdminClients.IDENTITY_PROVIDER_MGT_SERVICE_CLIENT.equals(client)) {
            identityProviderMgtServiceClients.put(portOffset, new IdentityProviderMgtServiceClient(sessionCookie, serviceUrl));
        } else if (CommonConstants.AdminClients.USER_MANAGEMENT_CLIENT.equals(client)) {
            userMgtServiceClients.put(portOffset, new UserManagementClient(serviceUrl, sessionCookie));
        }
    }
}
Also used : ConfigurationContext(org.apache.axis2.context.ConfigurationContext) AuthenticatorClient(org.wso2.carbon.integration.common.admin.client.AuthenticatorClient) CommonConstants(org.wso2.identity.integration.test.utils.CommonConstants) ApplicationManagementServiceClient(org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient) UserManagementClient(org.wso2.identity.integration.common.clients.UserManagementClient) IdentityProviderMgtServiceClient(org.wso2.identity.integration.common.clients.Idp.IdentityProviderMgtServiceClient) CharonException(org.wso2.charon.core.exceptions.CharonException) XPathExpressionException(javax.xml.xpath.XPathExpressionException)

Example 28 with UserManagementClient

use of org.wso2.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.

the class ApplicationManagementTestCase method testInit.

@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init();
    loginAndObtainSessionCookie();
    applicationManagementServiceClient = new ApplicationManagementServiceClient(sessionCookie, backendServiceURL, configContext);
    userMgtClient = new UserManagementClient(backendServiceURL, sessionCookie);
    userMgtClient.addRole(IDP_ROLE_1, new String[0], new String[] { PERMISSION_ADMIN_LOGIN });
    identityProviderMgtServiceClient = new IdentityProviderMgtServiceClient(sessionCookie, backendServiceURL);
    claimMetadataManagementServiceClient = new ClaimMetadataManagementServiceClient(backendServiceURL, sessionCookie);
    populateData();
}
Also used : ClaimMetadataManagementServiceClient(org.wso2.identity.scenarios.commons.clients.claims.ClaimMetadataManagementServiceClient) ApplicationManagementServiceClient(org.wso2.identity.scenarios.commons.clients.application.mgt.ApplicationManagementServiceClient) UserManagementClient(org.wso2.identity.scenarios.commons.clients.UserManagementClient) IdentityProviderMgtServiceClient(org.wso2.identity.scenarios.commons.clients.Idp.IdentityProviderMgtServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 29 with UserManagementClient

use of org.wso2.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.

the class ProvisionUserWithAdminRights method testInit.

@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init();
    loginAndObtainSessionCookie();
    userManagementClient = new UserManagementClient(backendServiceURL, sessionCookie);
}
Also used : UserManagementClient(org.wso2.identity.scenarios.commons.clients.UserManagementClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 30 with UserManagementClient

use of org.wso2.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.

the class ManagePrimaryRolesWithPermissionTestCase method testInit.

@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init();
    loginAndObtainSessionCookie();
    userManagementClient = new UserManagementClient(backendServiceURL, sessionCookie);
}
Also used : UserManagementClient(org.wso2.identity.scenarios.commons.clients.UserManagementClient) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

UserManagementClient (org.wso2.identity.integration.common.clients.UserManagementClient)47 BeforeClass (org.testng.annotations.BeforeClass)30 AuthenticatorClient (org.wso2.carbon.integration.common.admin.client.AuthenticatorClient)19 File (java.io.File)8 Test (org.testng.annotations.Test)8 ISIntegrationTest (org.wso2.identity.integration.common.utils.ISIntegrationTest)8 ServerConfigurationManager (org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager)7 SetEnvironment (org.wso2.carbon.automation.engine.annotations.SetEnvironment)6 UserProfileMgtServiceClient (org.wso2.identity.integration.common.clients.UserProfileMgtServiceClient)6 RemoteUserStoreManagerServiceClient (org.wso2.identity.integration.common.clients.usermgt.remote.RemoteUserStoreManagerServiceClient)6 LoginLogoutClient (org.wso2.carbon.integration.common.utils.LoginLogoutClient)5 IdentityProviderMgtServiceClient (org.wso2.identity.integration.common.clients.Idp.IdentityProviderMgtServiceClient)5 ApplicationManagementServiceClient (org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient)4 AfterClass (org.testng.annotations.AfterClass)3 AutomationContext (org.wso2.carbon.automation.engine.context.AutomationContext)3 UserManagementClient (org.wso2.carbon.integration.common.admin.client.UserManagementClient)3 UserInformationRecoveryServiceClient (org.wso2.identity.integration.common.clients.mgt.UserInformationRecoveryServiceClient)3 UserStoreConfigAdminServiceClient (org.wso2.identity.integration.common.clients.user.store.config.UserStoreConfigAdminServiceClient)3 UserManagementClient (org.wso2.identity.scenarios.commons.clients.UserManagementClient)3 XPathExpressionException (javax.xml.xpath.XPathExpressionException)2