Search in sources :

Example 56 with SetEnvironment

use of org.wso2.carbon.automation.engine.annotations.SetEnvironment in project product-is by wso2.

the class UserInformationRecoveryServiceTestCase method testRegisterUserWithInvalidClaims.

@SetEnvironment(executionEnvironments = { ExecutionEnvironment.ALL })
@Test(groups = "wso2.is", description = "Check user registration validation with Invalid Claims", dependsOnMethods = "testRegisterUser")
public void testRegisterUserWithInvalidClaims() throws Exception {
    VerificationBean bean = infoRecoveryClient.registerUser(null, "passWord1@", null, "default", null);
    Assert.assertNotNull(bean.getError(), "The expected error message is null with null return");
}
Also used : VerificationBean(org.wso2.carbon.identity.mgt.stub.beans.VerificationBean) SetEnvironment(org.wso2.carbon.automation.engine.annotations.SetEnvironment) Test(org.testng.annotations.Test) ISIntegrationTest(org.wso2.identity.integration.common.utils.ISIntegrationTest)

Example 57 with SetEnvironment

use of org.wso2.carbon.automation.engine.annotations.SetEnvironment in project product-is by wso2.

the class UserInformationRecoveryServiceTestCase method testRegisterExistingUser.

@SetEnvironment(executionEnvironments = { ExecutionEnvironment.ALL })
@Test(groups = "wso2.is", description = "Check existing user registration validation", dependsOnMethods = "testRegisterUser")
public void testRegisterExistingUser() 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.getError(), "The expected error message is null with null return");
}
Also used : VerificationBean(org.wso2.carbon.identity.mgt.stub.beans.VerificationBean) UserIdentityClaimDTO(org.wso2.carbon.identity.mgt.stub.dto.UserIdentityClaimDTO) SetEnvironment(org.wso2.carbon.automation.engine.annotations.SetEnvironment) Test(org.testng.annotations.Test) ISIntegrationTest(org.wso2.identity.integration.common.utils.ISIntegrationTest)

Example 58 with SetEnvironment

use of org.wso2.carbon.automation.engine.annotations.SetEnvironment in project product-is by wso2.

the class UserInformationRecoveryServiceTestCase method testVerifyUser.

/*
     * To validate password reset without captcha validation is to follow the method calls as
     * verifyUser() -> sendRecoveryNotification() -> verifyConfirmationCode() -> updatePassword()
     * Since cannot answer the question the test need to carryout with Captcha.Verification.Internally.Managed=false
     */
@SetEnvironment(executionEnvironments = { ExecutionEnvironment.ALL })
@Test(groups = "wso2.is", description = "Check verify user", dependsOnMethods = "testGetCaptcha")
public void testVerifyUser() throws Exception {
    VerificationBean bean = infoRecoveryClient.verifyUser("user11", null);
    Assert.assertNotNull(bean, "Verify User has failed with null return");
    // Assert.assertTrue(bean.getVerified(), "Verify User has failed for user11");
    // Assert.assertNotNull(bean.getKey(), "Verify User has failed with null key return");
    confKey = bean.getKey();
}
Also used : VerificationBean(org.wso2.carbon.identity.mgt.stub.beans.VerificationBean) SetEnvironment(org.wso2.carbon.automation.engine.annotations.SetEnvironment) Test(org.testng.annotations.Test) ISIntegrationTest(org.wso2.identity.integration.common.utils.ISIntegrationTest)

Aggregations

SetEnvironment (org.wso2.carbon.automation.engine.annotations.SetEnvironment)58 Test (org.testng.annotations.Test)45 ISIntegrationTest (org.wso2.identity.integration.common.utils.ISIntegrationTest)29 Resource (org.apache.wink.client.Resource)16 BasicAuthInfo (org.wso2.identity.integration.test.utils.BasicAuthInfo)16 VerificationBean (org.wso2.carbon.identity.mgt.stub.beans.VerificationBean)14 ClientConfig (org.apache.wink.client.ClientConfig)12 RestClient (org.apache.wink.client.RestClient)12 SCIMResponseHandler (org.wso2.identity.integration.test.scim.utils.SCIMResponseHandler)12 File (java.io.File)9 BeforeClass (org.testng.annotations.BeforeClass)9 UserIdentityClaimDTO (org.wso2.carbon.identity.mgt.stub.dto.UserIdentityClaimDTO)8 AuthenticatorClient (org.wso2.carbon.integration.common.admin.client.AuthenticatorClient)7 UserManagementClient (org.wso2.identity.integration.common.clients.UserManagementClient)6 ServerConfigurationManager (org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager)5 JSONObject (org.json.simple.JSONObject)4 FlaggedName (org.wso2.carbon.user.mgt.stub.types.carbon.FlaggedName)4 SCIMClient (org.wso2.charon.core.client.SCIMClient)4 RemoteUserStoreManagerServiceClient (org.wso2.identity.integration.common.clients.usermgt.remote.RemoteUserStoreManagerServiceClient)4 ClaimValue (org.wso2.carbon.um.ws.api.stub.ClaimValue)3