use of org.wso2.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.
the class ReadOnlyLDAPUserStoreManagerTestCase method configureServer.
@BeforeClass(alwaysRun = true)
public void configureServer() throws Exception {
super.init();
userMgtClient = new UserManagementClient(backendURL, getSessionCookie());
authenticatorClient = new AuthenticatorClient(backendURL);
Assert.assertTrue(userMgtClient.roleNameExists(newUserRole), "Role name doesn't exists");
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();
super.init(TestUserMode.SUPER_TENANT_ADMIN);
}
use of org.wso2.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.
the class UserMgtServiceAbstractTestCase method testInit.
protected void testInit() throws Exception {
super.init();
userMgtClient = new UserManagementClient(backendURL, sessionCookie);
loginManger = new AuthenticatorClient(backendURL);
adminUsername = userInfo.getUserName();
adminPassword = userInfo.getPassword();
}
use of org.wso2.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.
the class UserMgtTestCase method testGetRolesOfCurrentUser.
@Test(groups = "wso2.is", description = "Check get roles of current user")
public void testGetRolesOfCurrentUser() throws Exception {
if (nameExists(userMgtClient.getAllRolesNames("umRole5", 100), "umRole5")) {
userMgtClient.deleteRole("umRole5");
}
userMgtClient.addRole("umRole5", new String[] { "user3" }, new String[] { "admin" }, false);
UserManagementClient userMgtClient1 = new UserManagementClient(isServer.getContextUrls().getBackEndUrl(), "user3", "passWord1@");
Assert.assertTrue(nameExists(userMgtClient1.getRolesOfCurrentUser(), "umRole5"), "Getting current user roles has failed.");
userMgtClient.deleteRole("umRole5");
}
use of org.wso2.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.
the class RemoteUserStoreManagerServiceTestCase method testAddRole.
@Test(priority = 1, groups = "wso2.is", description = "Test addRole and isExistingRole operations")
public void testAddRole() throws Exception {
// add two test roles with empty users
// remoteUserStoreManagerClient.addRole(role1, null, null);
remoteUserStoreManagerClient.addRole(role2, null, null);
// Add role1 with configure, login, manage, monitor, protected permissions
UserManagementClient userMgtClient = new UserManagementClient(backendURL, sessionCookie);
String[] permissions = { "/permission/admin/configure/", "/permission/admin/login", "/permission/admin/manage/", "/permission/admin/monitor", "/permission/protected" };
userMgtClient.addRole(role1, null, permissions);
// verify role addition
Assert.assertTrue(remoteUserStoreManagerClient.isExistingRole(role1), "Adding new role failed : " + role1);
Assert.assertTrue(remoteUserStoreManagerClient.isExistingRole(role2), "Adding new role failed : " + role2);
}
use of org.wso2.carbon.integration.common.admin.client.UserManagementClient in project product-is by wso2.
the class AbstractUUIDUMTestCase method init.
protected void init() throws Exception {
super.init();
userMgtClient = new UUIDUserStoreManagerServiceClient(backendURL, sessionCookie);
oldUserMgtClient = new UserManagementClient(backendURL, sessionCookie);
loginManger = new AuthenticatorClient(backendURL);
adminUsername = userInfo.getUserName();
adminPassword = userInfo.getPassword();
}
Aggregations