use of org.wso2.carbon.automation.engine.annotations.SetEnvironment in project product-is by wso2.
the class UserInformationRecoveryServiceTenantEmailUserTestCase 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");
File defaultTomlFile = getDeploymentTomlFile(carbonHome);
File configuredTomlFile = new File(getISResourceLocation() + File.separator + "identityMgt" + File.separator + "user_mgt_regex_changed.toml");
scm = new ServerConfigurationManager(isServer);
scm.applyConfigurationWithoutRestart(identityMgtConfigFile, identityMgtServerFile, true);
scm.applyConfigurationWithoutRestart(configuredTomlFile, defaultTomlFile, true);
scm.restartGracefully();
super.init();
tenantServiceClient = new TenantManagementServiceClient(isServer.getContextUrls().getBackEndUrl(), sessionCookie);
tenantServiceClient.addTenant(TENANT_DOMAIN, TENANT_ADMIN_TENANT_AWARE_USERNAME, TENANT_ADMIN_PASSWORD, TENANT_ADMIN_USERNAME, "Info", "Recovery");
loginManger = new AuthenticatorClient(backendURL);
sessionCookie = this.loginManger.login(TENANT_ADMIN_USERNAME, TENANT_ADMIN_PASSWORD, isServer.getInstance().getHosts().get(profileName));
userMgtClient = new UserManagementClient(backendURL, sessionCookie);
infoRecoveryClient = new UserInformationRecoveryServiceClient(backendURL, sessionCookie);
userMgtClient.addUser(TENANT_USER, "passWord1@", null, profileName);
}
use of org.wso2.carbon.automation.engine.annotations.SetEnvironment in project product-is by wso2.
the class UserInformationRecoveryServiceTenantEmailUserTestCase method testVerifyUserAccount.
@SetEnvironment(executionEnvironments = { ExecutionEnvironment.ALL })
@Test(groups = "wso2.is", description = "Check user account verification")
public void testVerifyUserAccount() throws Exception {
UserIdentityClaimDTO[] claims = new UserIdentityClaimDTO[1];
UserIdentityClaimDTO claimEmail = new UserIdentityClaimDTO();
claimEmail.setClaimUri(USERNAME_CLAIM_URI);
claimEmail.setClaimValue(TENANT_USER);
claims[0] = claimEmail;
VerificationBean bean = infoRecoveryClient.verifyAccount(claims, null, TENANT_DOMAIN);
Assert.assertTrue(bean.getVerified(), "Verifying user account has failed with null return");
}
use of org.wso2.carbon.automation.engine.annotations.SetEnvironment in project product-is by wso2.
the class UserInformationRecoveryServiceTestCase method testConfirmUserSelfRegistration.
@SetEnvironment(executionEnvironments = { ExecutionEnvironment.ALL })
@Test(groups = "wso2.is", description = "Check user registration confirmation", dependsOnMethods = "testRegisterUser")
public void testConfirmUserSelfRegistration() throws Exception {
VerificationBean bean = infoRecoveryClient.confirmUserSelfRegistration("user2", confKey, null, null);
Assert.assertNotNull(bean, "Confirmation of user registration has failed with null return");
}
use of org.wso2.carbon.automation.engine.annotations.SetEnvironment in project product-is by wso2.
the class UserInformationRecoveryServiceTestCase method testVerifyUserAccount.
// @SetEnvironment(executionEnvironments = { ExecutionEnvironment.integration_all })
// @Test(groups = "wso2.is", description = "Check getting supported claims")
// public void testGetUserIdentitySupportedClaims() throws Exception {
// loginManger.login("admin", "admin", isServer.getBackEndUrl());
// UserIdentityClaimDTO[] bean = infoRecoveryClient.getUserIdentitySupportedClaims("http://wso2.org/claims");
// Assert.assertNotNull(bean, "Getting supported claims has failed with null return");
// }
@SetEnvironment(executionEnvironments = { ExecutionEnvironment.ALL })
@Test(groups = "wso2.is", description = "Check user account verification", dependsOnMethods = "testVerifyUserChallengeAnswer")
public void testVerifyUserAccount() throws Exception {
UserIdentityClaimDTO[] claims = new UserIdentityClaimDTO[2];
UserIdentityClaimDTO claimEmail = new UserIdentityClaimDTO();
claimEmail.setClaimUri("http://wso2.org/claims/emailaddress");
claimEmail.setClaimValue("user11@wso2.com");
UserIdentityClaimDTO claimLastName = new UserIdentityClaimDTO();
claimLastName.setClaimUri("http://wso2.org/claims/givenname");
claimLastName.setClaimValue("user11");
claims[0] = claimEmail;
claims[1] = claimLastName;
VerificationBean bean = infoRecoveryClient.verifyAccount(claims, null, null);
Assert.assertNotNull(bean, "Verifying user account has failed with null return");
}
use of org.wso2.carbon.automation.engine.annotations.SetEnvironment in project product-is by wso2.
the class UserInformationRecoveryServiceTestCase method testGetCaptcha.
@SetEnvironment(executionEnvironments = { ExecutionEnvironment.ALL })
@Test(groups = "wso2.is", description = "Check get captcha", dependsOnMethods = "testListUsers")
public void testGetCaptcha() throws Exception {
CaptchaInfoBean bean = infoRecoveryClient.getCaptcha();
Assert.assertNotNull(bean, "Getting the captcha call failed with null return");
Assert.assertNotNull(bean.getImagePath(), "Getting image path from captcha has failed.");
Assert.assertNotNull(bean.getSecretKey(), "Getting secret key from captcha has failed.");
}
Aggregations