use of org.wso2.identity.scenarios.commons.clients.UserManagementClient in project product-is by wso2.
the class UserManagementServiceAbstractTest method doInit.
public void doInit() throws Exception {
// creating context as super admin
super.init(TestUserMode.SUPER_TENANT_ADMIN);
userMgtClient = new UserManagementClient(backendURL, getSessionCookie());
authenticatorClient = new AuthenticatorClient(backendURL);
setUserName();
setUserPassword();
setUserRole();
Assert.assertNotNull(newUserName, "Please set a value to userName");
Assert.assertNotNull(newUserRole, "Please set a value to userRole");
}
use of org.wso2.identity.scenarios.commons.clients.UserManagementClient in project product-is by wso2.
the class UserMgtTestCase method testInit.
@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
super.init();
logManger = new AuthenticatorClient(backendURL);
userMgtClient = new UserManagementClient(backendURL, sessionCookie);
if (!nameExists(userMgtClient.listAllUsers("testAdminUser", 100), "testAdminUser")) {
userMgtClient.addUser("testAdminUser", "testAdminUser@123", new String[] { "admin" }, "default");
}
userMgtClient.addUser("user1", "passWord1@", null, "default");
userMgtClient.addUser("user2", "passWord1@", null, "default");
userMgtClient.addUser("user3", "passWord1@", new String[] { "admin" }, "default");
userMgtClient.addRole("umRole1", null, new String[] { "login" }, false);
userMgtClient.addRole("umRole2", new String[] { "user1" }, new String[] { "login" }, false);
userMgtClient.addRole("umRole3", null, new String[] { "login" }, false);
}
use of org.wso2.identity.scenarios.commons.clients.UserManagementClient in project product-is by wso2.
the class UserMgtTestCase method testChangePasswordByUser.
@Test(groups = "wso2.is", description = "Check change logged user password")
public void testChangePasswordByUser() throws Exception {
userMgtClient.addUser("user6", "passWord1@", new String[] { "admin" }, "default");
Assert.assertTrue(nameExists(userMgtClient.listAllUsers("user6", 10), "user6"), "Adding user 'user6' is failed.");
UserManagementClient userMgtClient1 = new UserManagementClient(isServer.getContextUrls().getBackEndUrl(), "user6", "passWord1@");
userMgtClient.changePasswordByUser("user6@carbon.super", "passWord1@", "passwordS1@");
String value = this.logManger.login("user6", "passwordS1@", isServer.getInstance().getHosts().get("default"));
Assert.assertTrue((value.indexOf("JSESSIONID") != -1), "User password change failed.");
userMgtClient.deleteUser("user6");
}
use of org.wso2.identity.scenarios.commons.clients.UserManagementClient in project product-is by wso2.
the class RemoteAuthorizationManagerServiceTestCase method testInit.
@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
super.init();
userMgtClient = new UserManagementClient(backendURL, sessionCookie);
remoteAuthorizationManagerServiceClient = new RemoteAuthorizationManagerServiceClient(backendURL, sessionCookie);
// Create users
userMgtClient.addUser("user1", "passWord1@", null, "default");
userMgtClient.addUser("user2", "passWord1@", null, "default");
userMgtClient.addUser("user3", "passWord1@", null, "default");
userMgtClient.addUser("user4", "passWord1@", null, "default");
// Create roles
userMgtClient.addRole("role1", null, null);
userMgtClient.addRole("role2", null, null);
userMgtClient.addRole("role3", null, null);
userMgtClient.addRole("role4", null, null);
userMgtClient.addRole("role5", null, null);
userMgtClient.addRole("role6", null, null);
}
use of org.wso2.identity.scenarios.commons.clients.UserManagementClient in project product-is by wso2.
the class UserAccountConnectorTestCase method testInit.
@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
super.init();
configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, null);
serviceClient = new UserAccountConnectorServiceClient(sessionCookie, backendURL, configContext);
userMgtClient = new UserManagementClient(backendURL, sessionCookie);
}
Aggregations