use of org.wso2.carbon.identity.user.profile.stub.types.UserFieldDTO in project product-is by wso2.
the class UserProfileMgtTestCase method testGetUserProfile.
@Test(groups = "wso2.is", description = "Check get user profile")
public void testGetUserProfile() throws Exception {
UserProfileDTO profile = userProfileMgtClient.getUserProfile(userId1, "default");
UserFieldDTO[] fields = profile.getFieldValues();
String displayValue = null;
for (UserFieldDTO field : fields) {
if ("Last Name".equals(field.getDisplayName())) {
displayValue = field.getFieldValue();
break;
}
}
Assert.assertTrue(userId1.equals(displayValue), "Getting user profile has failed.");
}
use of org.wso2.carbon.identity.user.profile.stub.types.UserFieldDTO in project product-is by wso2.
the class AdminForcedPasswordResetTestCase method setUserClaim.
protected void setUserClaim(String claimURI, String calimValue) throws LogoutAuthenticationExceptionException, RemoteException, UserAdminUserAdminException, UserProfileMgtServiceUserProfileExceptionException {
userProfileMgtClient = new UserProfileMgtServiceClient(backendURL, sessionCookie);
UserProfileDTO profile = new UserProfileDTO();
profile.setProfileName(PROFILE_NAME);
UserFieldDTO passwordResetClaim = new UserFieldDTO();
passwordResetClaim.setClaimUri(claimURI);
passwordResetClaim.setFieldValue(calimValue);
UserFieldDTO[] fields = new UserFieldDTO[1];
fields[0] = passwordResetClaim;
profile.setFieldValues(fields);
userProfileMgtClient.setUserProfile(TEST_USER_USERNAME, profile);
}
use of org.wso2.carbon.identity.user.profile.stub.types.UserFieldDTO in project product-is by wso2.
the class EntitlementServiceTestCase method testSetUserProfile.
@Test(groups = "wso2.is", description = "Check set user profile")
public void testSetUserProfile() throws RemoteException, UserProfileMgtServiceUserProfileExceptionException {
UserProfileDTO profile = userProfileMgtClient.getUserProfile("admin", "default");
UserFieldDTO country = new UserFieldDTO();
country.setClaimUri("http://wso2.org/claims/country");
country.setFieldValue("SL");
UserFieldDTO[] fields = profile.getFieldValues();
UserFieldDTO[] newfields = new UserFieldDTO[fields.length];
for (int i = 0; i < fields.length; i++) {
if (fields[i].getDisplayName().toString().equals("Country")) {
newfields[i] = country;
} else {
newfields[i] = fields[i];
}
}
profile.setFieldValues(newfields);
userProfileMgtClient.setUserProfile("admin", profile);
}
Aggregations