Search in sources :

Example 36 with UserManagementClient

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

the class UserStoreDeployerTestCase method testInit.

@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init();
    srcFile = new File(getTestArtifactLocation() + File.separator + "wso2_com.xml");
    userStoreConfigFilePath = deploymentDirectory + File.separator;
    userStoreConfigurationClient = new UserStoreConfigAdminServiceClient(backendURL, sessionCookie);
    userMgtClient = new UserManagementClient(backendURL, sessionCookie);
}
Also used : UserManagementClient(org.wso2.identity.integration.common.clients.UserManagementClient) UserStoreConfigAdminServiceClient(org.wso2.identity.integration.common.clients.user.store.config.UserStoreConfigAdminServiceClient) File(java.io.File) BeforeClass(org.testng.annotations.BeforeClass)

Example 37 with UserManagementClient

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

the class CARBON15051EmailLoginTestCase method testInit.

@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
    super.init(TestUserMode.SUPER_TENANT_ADMIN);
    String carbonHome = Utils.getResidentCarbonHome();
    File defaultTomlFile = getDeploymentTomlFile(carbonHome);
    File emailLoginConfigFile = new File(getISResourceLocation() + File.separator + "userMgt" + File.separator + "carbon15051" + File.separator + "email_login_config.toml");
    serverConfigurationManager = new ServerConfigurationManager(isServer);
    serverConfigurationManager.applyConfigurationWithoutRestart(emailLoginConfigFile, defaultTomlFile, true);
    serverConfigurationManager.restartGracefully();
    super.init(TestUserMode.SUPER_TENANT_ADMIN);
    loginLogoutClient = new LoginLogoutClient(isServer);
    adminUsername = userInfo.getUserName();
    adminPassword = userInfo.getPassword();
    userManagementClient = new UserManagementClient(backendURL, getSessionCookie());
    userManagementClient.addUser("user1@test.com", "passWord1@", new String[] { "admin" }, null);
}
Also used : LoginLogoutClient(org.wso2.carbon.integration.common.utils.LoginLogoutClient) ServerConfigurationManager(org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager) UserManagementClient(org.wso2.carbon.integration.common.admin.client.UserManagementClient) File(java.io.File) BeforeClass(org.testng.annotations.BeforeClass)

Example 38 with UserManagementClient

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

the class NotificationOnUserOperationTestCase method atEnd.

@AfterClass(alwaysRun = true)
public void atEnd() throws Exception {
    resetISConfiguration();
    super.init();
    userMgtServiceClient = new UserManagementClient(backendURL, sessionCookie);
    userMgtServiceClient.deleteUser("scimUser");
    userMgtServiceClient.deleteUser("NotificationUser");
    userMgtServiceClient.deleteRole("NotificationRole");
}
Also used : UserManagementClient(org.wso2.identity.integration.common.clients.UserManagementClient) AfterClass(org.testng.annotations.AfterClass)

Example 39 with UserManagementClient

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

the class JDBCUserStoreAddingTestCase method addUserIntoJDBCUserStore.

@Test(groups = "wso2.is", dependsOnMethods = "testAddJDBCUserStore")
public void addUserIntoJDBCUserStore() throws Exception {
    userMgtClient = new UserManagementClient(backendURL, getSessionCookie());
    authenticatorClient = new AuthenticatorClient(backendURL);
    userMgtClient.addRole(newUserRole, null, new String[] { PERMISSION_LOGIN });
    Assert.assertTrue(userMgtClient.roleNameExists(newUserRole), "Role name doesn't exists");
    userMgtClient.addUser(newUserName, newUserPassword, new String[] { newUserRole }, null);
    Assert.assertTrue(userMgtClient.userNameExists(newUserRole, newUserName), "User name doesn't exists");
    String sessionCookie = authenticatorClient.login(newUserName, newUserPassword, isServer.getInstance().getHosts().get("default"));
    Assert.assertTrue(sessionCookie.contains("JSESSIONID"), "Session Cookie not found. Login failed");
    authenticatorClient.logOut();
}
Also used : AuthenticatorClient(org.wso2.carbon.integration.common.admin.client.AuthenticatorClient) UserManagementClient(org.wso2.identity.integration.common.clients.UserManagementClient) ISIntegrationTest(org.wso2.identity.integration.common.utils.ISIntegrationTest) Test(org.testng.annotations.Test)

Example 40 with UserManagementClient

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

the class IDENTITY4776SCIMServiceWithOAuthTestCase method init.

@BeforeClass(alwaysRun = true)
public void init() throws Exception {
    super.init(TestUserMode.SUPER_TENANT_ADMIN);
    String carbonHome = Utils.getResidentCarbonHome();
    File defaultTomlFile = getDeploymentTomlFile(carbonHome);
    File scimConfiguredTomlFile = new File(getISResourceLocation() + File.separator + "scim" + File.separator + "IDENTITY4776" + File.separator + "catalina_server_config.toml");
    serverConfigurationManager = new ServerConfigurationManager(isServer);
    serverConfigurationManager.applyConfigurationWithoutRestart(scimConfiguredTomlFile, defaultTomlFile, true);
    serverConfigurationManager.restartGracefully();
    super.init(TestUserMode.SUPER_TENANT_ADMIN);
    LoginLogoutClient loginLogoutClient = new LoginLogoutClient(isServer);
    sessionCookie = loginLogoutClient.login();
    userStoreConfigAdminServiceClient = new UserStoreConfigAdminServiceClient(backendURL, sessionCookie);
    userMgtClient = new UserManagementClient(backendURL, sessionCookie);
    scimUrl = backendURL.substring(0, 22) + "/wso2/scim/";
    oauth2Endpoint = backendURL.substring(0, 22) + "/oauth2/token";
}
Also used : LoginLogoutClient(org.wso2.carbon.integration.common.utils.LoginLogoutClient) ServerConfigurationManager(org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager) UserManagementClient(org.wso2.identity.integration.common.clients.UserManagementClient) UserStoreConfigAdminServiceClient(org.wso2.identity.integration.common.clients.user.store.config.UserStoreConfigAdminServiceClient) File(java.io.File) 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