use of org.wso2.carbon.automation.engine.annotations.SetEnvironment in project product-is by wso2.
the class UserInformationRecoveryServiceTestCase method testUpdatePassword.
@SetEnvironment(executionEnvironments = { ExecutionEnvironment.ALL })
@Test(groups = "wso2.is", description = "Check update password", dependsOnMethods = "testVerifyConfirmationCode")
public void testUpdatePassword() throws Exception {
VerificationBean bean = infoRecoveryClient.updatePassword("user11", confKey, "passWord2@");
Assert.assertNotNull(bean, "Update password has failed with null return");
// Assert.assertNotNull(bean.getKey(), "Update password has failed with null key return");
// String value = loginManger.login("user11", "passWord2@", isServer.getBackEndUrl());
}
use of org.wso2.carbon.automation.engine.annotations.SetEnvironment in project product-is by wso2.
the class UserInformationRecoveryServiceTestCase method testSendRecoveryNotification.
@SetEnvironment(executionEnvironments = { ExecutionEnvironment.ALL })
@Test(groups = "wso2.is", description = "Check recovery notification sending", dependsOnMethods = "testVerifyUser")
public void testSendRecoveryNotification() throws Exception {
UserProfileDTO profile = profileClient.getUserProfile("user11", "default");
UserFieldDTO email = new UserFieldDTO();
email.setFieldValue("testuser@wso2.com");
email.setClaimUri("http://wso2.org/claims/emailaddress");
UserFieldDTO[] params = new UserFieldDTO[1];
params[0] = email;
profile.setFieldValues(params);
profileClient.setUserProfile("user11", profile);
VerificationBean bean = infoRecoveryClient.sendRecoveryNotification("user11", confKey, "EMAIL");
Assert.assertNotNull(bean, "Notification sending has failed with null return");
// Assert.assertTrue(bean.getVerified(), "Notification sending has failed for user11");
// confKey = bean.getKey();
}
use of org.wso2.carbon.automation.engine.annotations.SetEnvironment in project product-is by wso2.
the class UserInformationRecoveryServiceTestCase method testInit.
@SetEnvironment(executionEnvironments = { ExecutionEnvironment.ALL })
@BeforeClass(alwaysRun = true)
public void testInit() throws Exception {
super.init();
String carbonHome = Utils.getResidentCarbonHome();
identityMgtServerFile = new File(carbonHome + File.separator + "repository" + File.separator + "conf" + File.separator + "identity" + File.separator + "identity-mgt.properties");
File identityMgtConfigFile = new File(getISResourceLocation() + File.separator + "identityMgt" + File.separator + "identity-mgt-enabled.properties");
axisServerFile = new File(carbonHome + File.separator + "repository" + File.separator + "conf" + File.separator + "axis2" + File.separator + "axis2.xml");
File axisConfigFile = new File(getISResourceLocation() + File.separator + "identityMgt" + File.separator + "axis2.xml");
scm = new ServerConfigurationManager(isServer);
scm.applyConfigurationWithoutRestart(identityMgtConfigFile, identityMgtServerFile, true);
scm.applyConfigurationWithoutRestart(axisConfigFile, axisServerFile, true);
scm.restartGracefully();
super.init();
loginManger = new AuthenticatorClient(backendURL);
userMgtClient = new UserManagementClient(backendURL, sessionCookie);
infoRecoveryClient = new UserInformationRecoveryServiceClient(backendURL, sessionCookie);
profileClient = new UserProfileMgtServiceClient(backendURL, sessionCookie);
loginManger.login(isServer.getSuperTenant().getTenantAdmin().getUserName(), isServer.getSuperTenant().getTenantAdmin().getPassword(), isServer.getInstance().getHosts().get("default"));
claimMgtClient = new ClaimManagementServiceClient(backendURL, sessionCookie);
ClaimDTO claim1 = new ClaimDTO();
claim1.setDialectURI("http://wso2.org/claims");
claim1.setClaimUri("http://wso2.org/claims/identity/unlockTime");
claim1.setDescription("Account Unlock time");
ClaimDTO claim2 = new ClaimDTO();
claim2.setDialectURI("http://wso2.org/claims");
claim2.setClaimUri("http://wso2.org/claims/identity/failedLoginAttempts");
claim2.setDescription("Failed login attempts");
ClaimMappingDTO claimMapping1 = new ClaimMappingDTO();
claimMapping1.setClaim(claim1);
claimMapping1.setMappedAttribute("description");
claimMgtClient.addNewClaimMapping(claimMapping1);
ClaimMappingDTO claimMapping2 = new ClaimMappingDTO();
claimMapping2.setClaim(claim2);
claimMapping2.setMappedAttribute("employeeType");
claimMgtClient.addNewClaimMapping(claimMapping2);
userMgtClient.addUser("user11", "passWord1@", null, "default");
userMgtClient.addRole("umRole11", new String[] { "user11" }, new String[] { "/permission/admin/login" }, false);
}
use of org.wso2.carbon.automation.engine.annotations.SetEnvironment in project product-is by wso2.
the class UserInformationRecoveryServiceTestCase method testRegisterUser.
@SetEnvironment(executionEnvironments = { ExecutionEnvironment.ALL })
@Test(groups = "wso2.is", description = "Check user registration", dependsOnMethods = "testVerifyUserAccount")
public void testRegisterUser() throws Exception {
UserIdentityClaimDTO[] claims = new UserIdentityClaimDTO[2];
UserIdentityClaimDTO claimEmail = new UserIdentityClaimDTO();
claimEmail.setClaimUri("http://wso2.org/claims/emailaddress");
claimEmail.setClaimValue("user2@wso2.com");
UserIdentityClaimDTO claimLastName = new UserIdentityClaimDTO();
claimLastName.setClaimUri("http://wso2.org/claims/givenname");
claimLastName.setClaimValue("user2");
claims[0] = claimEmail;
claims[1] = claimLastName;
VerificationBean bean = infoRecoveryClient.registerUser("user2", "passWord1@", claims, "default", null);
Assert.assertNotNull(bean, "Registering user account has failed with null return");
confKey = bean.getKey();
}
use of org.wso2.carbon.automation.engine.annotations.SetEnvironment in project product-is by wso2.
the class UserInformationRecoveryServiceTestCase method testGetUserChallengeQuestionIds.
@SetEnvironment(executionEnvironments = { ExecutionEnvironment.ALL })
@Test(groups = "wso2.is", description = "Check getting challenge question ids", dependsOnMethods = "testGetAllChallengeQuestions")
public void testGetUserChallengeQuestionIds() throws Exception {
ChallengeQuestionIdsDTO bean = infoRecoveryClient.getUserChallengeQuestionIds("user11", confKey);
Assert.assertNotNull(bean, "Getting challenge question ids has failed with null return");
}
Aggregations