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);
}
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);
}
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");
}
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();
}
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";
}
Aggregations