Search in sources :

Example 36 with FlaggedName

use of org.wso2.carbon.user.mgt.common.FlaggedName in project product-is by wso2.

the class UserMgtTestCase method testAddRole.

@Test(groups = "wso2.is", description = "Check role addition")
public void testAddRole() throws Exception {
    userMgtClient.addRole("loginRole", new String[] { "testAdminUser" }, new String[] { "/permission/admin/login" }, false);
    FlaggedName[] roles = userMgtClient.getRolesOfUser("testAdminUser", "loginRole", -1);
    Boolean isIncluded = false;
    for (FlaggedName role : roles) {
        if (role.getItemName().equalsIgnoreCase("loginRole")) {
            isIncluded = true;
        }
    }
    Assert.assertTrue(isIncluded, "Added role with user 'testAdminUser' could not be retrieved.");
}
Also used : FlaggedName(org.wso2.carbon.user.mgt.stub.types.carbon.FlaggedName) ISIntegrationTest(org.wso2.identity.integration.common.utils.ISIntegrationTest) Test(org.testng.annotations.Test)

Example 37 with FlaggedName

use of org.wso2.carbon.user.mgt.common.FlaggedName in project product-is by wso2.

the class UserMgtTestCase method testListUserByClaim.

@Test(groups = "wso2.is", description = "Check list users by claim value")
public void testListUserByClaim() throws Exception {
    ClaimValue claimValue = new ClaimValue();
    claimValue.setClaimURI("http://wso2.org/claims/lastname");
    claimValue.setValue("user3");
    FlaggedName[] allNames = userMgtClient.listUserByClaim(claimValue, "user*", 10);
    Assert.assertTrue(nameExists(allNames, "user3"), "List user with claim value has failed");
}
Also used : ClaimValue(org.wso2.carbon.user.mgt.stub.types.carbon.ClaimValue) FlaggedName(org.wso2.carbon.user.mgt.stub.types.carbon.FlaggedName) ISIntegrationTest(org.wso2.identity.integration.common.utils.ISIntegrationTest) Test(org.testng.annotations.Test)

Example 38 with FlaggedName

use of org.wso2.carbon.user.mgt.common.FlaggedName in project product-is by wso2.

the class SCIMServiceProviderUserTestCase method isUserExists.

private boolean isUserExists() throws Exception {
    boolean userExists = false;
    FlaggedName[] nameList = userMgtClient.listAllUsers(USERNAME, 100);
    for (FlaggedName name : nameList) {
        if (name.getItemName().contains(USERNAME)) {
            userExists = true;
        }
    }
    return userExists;
}
Also used : FlaggedName(org.wso2.carbon.user.mgt.stub.types.carbon.FlaggedName)

Example 39 with FlaggedName

use of org.wso2.carbon.user.mgt.common.FlaggedName in project product-is by wso2.

the class SCIMServiceProviderUserTestCase method isAllUsersExists.

private boolean isAllUsersExists(String response) throws Exception {
    boolean usersExists = false;
    FlaggedName[] nameList = userMgtClient.listAllUsers(USERNAME, 100);
    for (FlaggedName name : nameList) {
        if (response.contains(name.getItemName())) {
            usersExists = true;
        }
    }
    return usersExists;
}
Also used : FlaggedName(org.wso2.carbon.user.mgt.stub.types.carbon.FlaggedName)

Example 40 with FlaggedName

use of org.wso2.carbon.user.mgt.common.FlaggedName in project product-is by wso2.

the class IDENTITY4776SCIMServiceWithOAuthTestCase method isUserExists.

private boolean isUserExists() throws Exception {
    boolean userExists = false;
    FlaggedName[] nameList = userMgtClient.listAllUsers(SCIM_USER_NAME, 100);
    for (FlaggedName name : nameList) {
        if (name.getItemName().contains(SCIM_USER_NAME)) {
            userExists = true;
        }
    }
    return userExists;
}
Also used : FlaggedName(org.wso2.carbon.user.mgt.stub.types.carbon.FlaggedName)

Aggregations

FlaggedName (org.wso2.carbon.user.mgt.stub.types.carbon.FlaggedName)31 ArrayList (java.util.ArrayList)14 FlaggedName (org.wso2.carbon.user.mgt.common.FlaggedName)13 Test (org.testng.annotations.Test)12 UserAdminException (org.wso2.carbon.user.mgt.common.UserAdminException)10 AbstractUserStoreManager (org.wso2.carbon.user.core.common.AbstractUserStoreManager)9 ISIntegrationTest (org.wso2.identity.integration.common.utils.ISIntegrationTest)8 HashMap (java.util.HashMap)7 RegistryException (org.wso2.carbon.registry.api.RegistryException)7 UserStoreException (org.wso2.carbon.user.core.UserStoreException)7 UserStoreManager (org.wso2.carbon.user.core.UserStoreManager)7 JDBCUserStoreManager (org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager)7 ClaimValue (org.wso2.carbon.user.mgt.stub.types.carbon.ClaimValue)7 SetEnvironment (org.wso2.carbon.automation.engine.annotations.SetEnvironment)4 Mockito.anyString (org.mockito.Mockito.anyString)3 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)3 BeforeTest (org.testng.annotations.BeforeTest)3 AuthorizationManager (org.wso2.carbon.user.api.AuthorizationManager)3 UserAdminUserAdminException (org.wso2.carbon.user.mgt.stub.UserAdminUserAdminException)3 Field (java.lang.reflect.Field)2