Search in sources :

Example 1 with TenantManagementServiceClient

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

the class UserInformationRecoveryServiceTenantEmailUserTestCase method testInit.

@SetEnvironment(executionEnvironments = { ExecutionEnvironment.ALL })
@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init();
    String carbonHome = Utils.getResidentCarbonHome();
    identityMgtServerFile = new File(carbonHome + File.separator + "repository" + File.separator + "conf" + File.separator + "identity" + File.separator + "identity-mgt.properties");
    File identityMgtConfigFile = new File(getISResourceLocation() + File.separator + "identityMgt" + File.separator + "identity-mgt-enabled.properties");
    File defaultTomlFile = getDeploymentTomlFile(carbonHome);
    File configuredTomlFile = new File(getISResourceLocation() + File.separator + "identityMgt" + File.separator + "user_mgt_regex_changed.toml");
    scm = new ServerConfigurationManager(isServer);
    scm.applyConfigurationWithoutRestart(identityMgtConfigFile, identityMgtServerFile, true);
    scm.applyConfigurationWithoutRestart(configuredTomlFile, defaultTomlFile, true);
    scm.restartGracefully();
    super.init();
    tenantServiceClient = new TenantManagementServiceClient(isServer.getContextUrls().getBackEndUrl(), sessionCookie);
    tenantServiceClient.addTenant(TENANT_DOMAIN, TENANT_ADMIN_TENANT_AWARE_USERNAME, TENANT_ADMIN_PASSWORD, TENANT_ADMIN_USERNAME, "Info", "Recovery");
    loginManger = new AuthenticatorClient(backendURL);
    sessionCookie = this.loginManger.login(TENANT_ADMIN_USERNAME, TENANT_ADMIN_PASSWORD, isServer.getInstance().getHosts().get(profileName));
    userMgtClient = new UserManagementClient(backendURL, sessionCookie);
    infoRecoveryClient = new UserInformationRecoveryServiceClient(backendURL, sessionCookie);
    userMgtClient.addUser(TENANT_USER, "passWord1@", null, profileName);
}
Also used : AuthenticatorClient(org.wso2.carbon.integration.common.admin.client.AuthenticatorClient) ServerConfigurationManager(org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager) UserManagementClient(org.wso2.identity.integration.common.clients.UserManagementClient) File(java.io.File) TenantManagementServiceClient(org.wso2.identity.integration.common.clients.TenantManagementServiceClient) UserInformationRecoveryServiceClient(org.wso2.identity.integration.common.clients.mgt.UserInformationRecoveryServiceClient) BeforeClass(org.testng.annotations.BeforeClass) SetEnvironment(org.wso2.carbon.automation.engine.annotations.SetEnvironment)

Example 2 with TenantManagementServiceClient

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

the class DBSeperationTestCase method setUp.

@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    String carbonHome = Utils.getResidentCarbonHome();
    File defaultTomlFile = getDeploymentTomlFile(carbonHome);
    File configuredTomlFile = new File(getISResourceLocation() + File.separator + File.separator + "provisioning" + File.separator + "db_separation_config.toml");
    super.init();
    serverConfigurationManager = new ServerConfigurationManager(isServer);
    serverConfigurationManager.applyConfigurationWithoutRestart(configuredTomlFile, defaultTomlFile, true);
    serverConfigurationManager.restartGracefully();
    super.init();
    TenantManagementServiceClient tenantServiceClient = new TenantManagementServiceClient(backendURL, sessionCookie);
    tenantServiceClient.addTenant(TENANT_DOMAIN, TENANT_ADMIN, "password", TENANT_ADMIN + "@" + TENANT_DOMAIN, TENANT_ADMIN, "User");
    identityProviderMgtServiceClient = new IdentityProviderMgtServiceClient(TENANT_ADMIN + "@" + TENANT_DOMAIN, "password", backendURL);
}
Also used : ServerConfigurationManager(org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager) File(java.io.File) IdentityProviderMgtServiceClient(org.wso2.identity.integration.common.clients.Idp.IdentityProviderMgtServiceClient) TenantManagementServiceClient(org.wso2.identity.integration.common.clients.TenantManagementServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 3 with TenantManagementServiceClient

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

the class TenantDropDownTestCase method setUp.

@BeforeClass(alwaysRun = true)
public void setUp() throws Exception {
    super.init();
    applicationAuthenticationXml = new File(CarbonUtils.getCarbonHome() + File.separator + "repository" + File.separator + "conf" + File.separator + "identity" + File.separator + "application-authentication.xml");
    File applicationAuthenticationXmlToCopy = new File(FrameworkPathUtil.getSystemResourceLocation() + "artifacts" + File.separator + "IS" + File.separator + "tenantDropdown" + File.separator + "application-authentication-tanantDropdown-enabled.xml");
    authenticatorsXml = new File(CarbonUtils.getCarbonHome() + File.separator + "repository" + File.separator + "conf" + File.separator + "security" + File.separator + "authenticators.xml");
    File authenticatorsXmlToCopy = new File(FrameworkPathUtil.getSystemResourceLocation() + "artifacts" + File.separator + "IS" + File.separator + "tenantDropdown" + File.separator + "authenticators-tenantDropdown-enabled.xml");
    catalinaServerXml = new File(CarbonUtils.getCarbonHome() + File.separator + "repository" + File.separator + "conf" + File.separator + "tomcat" + File.separator + "catalina-server.xml");
    File catalinaServerXmlToCopy = new File(FrameworkPathUtil.getSystemResourceLocation() + "artifacts" + File.separator + "IS" + File.separator + "tenantDropdown" + File.separator + "catalina-server-tanantDropdown-enabled.xml");
    endpointConfigProperties = new File(CarbonUtils.getCarbonHome() + File.separator + "repository" + File.separator + "conf" + File.separator + "identity" + File.separator + "EndpointConfig.properties");
    File endpointConfigPropertiesToCopy = new File(FrameworkPathUtil.getSystemResourceLocation() + "artifacts" + File.separator + "IS" + File.separator + "tenantDropdown" + File.separator + "EndpointConfigTenantDropdownEnabled.properties");
    userIdentityMgt = new ServerConfigurationManager(isServer);
    userIdentityMgt.applyConfigurationWithoutRestart(applicationAuthenticationXmlToCopy, applicationAuthenticationXml, true);
    userIdentityMgt.applyConfigurationWithoutRestart(authenticatorsXmlToCopy, authenticatorsXml, true);
    userIdentityMgt.applyConfigurationWithoutRestart(catalinaServerXmlToCopy, catalinaServerXml, true);
    userIdentityMgt.applyConfigurationWithoutRestart(endpointConfigPropertiesToCopy, endpointConfigProperties, true);
    userIdentityMgt.restartGracefully();
    super.init();
    ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
    driver = BrowserManager.getWebDriver();
    tenantServiceClient = new TenantManagementServiceClient(isServer.getContextUrls().getBackEndUrl(), sessionCookie);
    tenantServiceClient.addTenant(TENANT_DOMAIN, "admin", "password", "admin@dropdown.com", "Dropdown", "User");
    ssoConfigServiceClient = new SAMLSSOConfigServiceClient(backendURL, sessionCookie);
    applicationManagementServiceClient = new ApplicationManagementServiceClient(sessionCookie, backendURL, configContext);
    ssoConfigServiceClient.addServiceProvider(createSsoServiceProviderDTO());
    createApplication();
    driver.get(isServer.getContextUrls().getWebAppURLHttps() + "/samlsso?spEntityID=" + SAML_ISSUER);
}
Also used : ConfigurationContext(org.apache.axis2.context.ConfigurationContext) ServerConfigurationManager(org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager) SAMLSSOConfigServiceClient(org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient) ApplicationManagementServiceClient(org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient) File(java.io.File) TenantManagementServiceClient(org.wso2.identity.integration.common.clients.TenantManagementServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 4 with TenantManagementServiceClient

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

the class RegistryMountTestCase method testInit.

@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init();
    logManger = new AuthenticatorClient(backendURL);
    serverConfigurationManager = new ServerConfigurationManager(isServer);
    tenantServiceClient = new TenantManagementServiceClient(isServer.getContextUrls().getBackEndUrl(), sessionCookie);
    tenantServiceClient.addTenant(TENANT_DOMAIN, TENANT_ADMIN_TENANT_AWARE_USERNAME, TENANT_ADMIN_PASSWORD, TENANT_ADMIN_USERNAME, "Registry", "Mount");
    sessionCookie = this.logManger.login(TENANT_ADMIN_USERNAME, TENANT_ADMIN_PASSWORD, isServer.getInstance().getHosts().get(profileName));
    configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
    applicationManagementServiceClient = new ApplicationManagementServiceClient(sessionCookie, backendURL, configContext);
    ssoConfigServiceClient = new SAMLSSOConfigServiceClient(backendURL, sessionCookie);
    httpClient = new DefaultHttpClient();
    createApplication();
    ssoConfigServiceClient.addServiceProvider(createSsoServiceProviderDTO());
    userId = UserUtil.getUserId(MultitenantUtils.getTenantAwareUsername(TENANT_ADMIN_USERNAME), TENANT_DOMAIN, TENANT_ADMIN_USERNAME, TENANT_ADMIN_PASSWORD);
}
Also used : AuthenticatorClient(org.wso2.carbon.integration.common.admin.client.AuthenticatorClient) ServerConfigurationManager(org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager) ApplicationManagementServiceClient(org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient) SAMLSSOConfigServiceClient(org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient) TenantManagementServiceClient(org.wso2.identity.integration.common.clients.TenantManagementServiceClient) DefaultHttpClient(org.apache.http.impl.client.DefaultHttpClient) BeforeClass(org.testng.annotations.BeforeClass)

Example 5 with TenantManagementServiceClient

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

the class RetrieveResidentIdPEntityIdTestCase method testInit.

@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init();
    changeISConfiguration();
    super.init();
    tenantServiceClient = new TenantManagementServiceClient(isServer.getContextUrls().getBackEndUrl(), sessionCookie);
}
Also used : TenantManagementServiceClient(org.wso2.identity.integration.common.clients.TenantManagementServiceClient) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

BeforeClass (org.testng.annotations.BeforeClass)5 TenantManagementServiceClient (org.wso2.identity.integration.common.clients.TenantManagementServiceClient)5 ServerConfigurationManager (org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager)4 File (java.io.File)3 AuthenticatorClient (org.wso2.carbon.integration.common.admin.client.AuthenticatorClient)2 ApplicationManagementServiceClient (org.wso2.identity.integration.common.clients.application.mgt.ApplicationManagementServiceClient)2 SAMLSSOConfigServiceClient (org.wso2.identity.integration.common.clients.sso.saml.SAMLSSOConfigServiceClient)2 ConfigurationContext (org.apache.axis2.context.ConfigurationContext)1 DefaultHttpClient (org.apache.http.impl.client.DefaultHttpClient)1 SetEnvironment (org.wso2.carbon.automation.engine.annotations.SetEnvironment)1 IdentityProviderMgtServiceClient (org.wso2.identity.integration.common.clients.Idp.IdentityProviderMgtServiceClient)1 UserManagementClient (org.wso2.identity.integration.common.clients.UserManagementClient)1 UserInformationRecoveryServiceClient (org.wso2.identity.integration.common.clients.mgt.UserInformationRecoveryServiceClient)1