Search in sources :

Example 6 with ChallengeQuestionMgtAdminClient

use of org.wso2.identity.integration.common.clients.challenge.questions.mgt.ChallengeQuestionMgtAdminClient in project product-is by wso2.

the class ChallengeQuestionManagementAdminServiceTestCase method addChallengeQuestionByLocale.

@Test(groups = "wso2.is", description = "Getting challenge questions of a user", priority = 3, sequential = true)
public void addChallengeQuestionByLocale() throws Exception {
    challengeQuestionsAdminClient = new ChallengeQuestionMgtAdminClient(backendURL, BOB_USERNAME, BOB_PASSWORD);
    ChallengeQuestion[] challengeQuestions = challengeQuestionsAdminClient.getChallengeQuestionsForLocale(SUPER_TENANT, BOB_LOCALE);
    int countBefore = challengeQuestions == null ? 0 : challengeQuestions.length;
    ChallengeQuestion challengeQuestion = new ChallengeQuestion();
    challengeQuestion.setQuestionSetId("newSet1");
    challengeQuestion.setQuestionId("q2");
    challengeQuestion.setQuestion("Challenge Question in xx_YY ????");
    challengeQuestion.setLocale(BOB_LOCALE);
    challengeQuestionsAdminClient.setChallengeQuestions(new ChallengeQuestion[] { challengeQuestion }, SUPER_TENANT);
    int countAfter = challengeQuestionsAdminClient.getChallengeQuestionsForLocale(SUPER_TENANT, BOB_LOCALE).length;
    assertTrue(countBefore + 1 == countAfter, "Adding a new challenge question for locale " + BOB_LOCALE + " failed in " + SUPER_TENANT);
}
Also used : ChallengeQuestionMgtAdminClient(org.wso2.identity.integration.common.clients.challenge.questions.mgt.ChallengeQuestionMgtAdminClient) ChallengeQuestion(org.wso2.carbon.identity.recovery.stub.model.ChallengeQuestion) ISIntegrationTest(org.wso2.identity.integration.common.utils.ISIntegrationTest) Test(org.testng.annotations.Test)

Aggregations

ChallengeQuestionMgtAdminClient (org.wso2.identity.integration.common.clients.challenge.questions.mgt.ChallengeQuestionMgtAdminClient)6 Test (org.testng.annotations.Test)5 ISIntegrationTest (org.wso2.identity.integration.common.utils.ISIntegrationTest)5 ChallengeQuestion (org.wso2.carbon.identity.recovery.stub.model.ChallengeQuestion)3 User (org.wso2.carbon.identity.application.common.model.xsd.User)2 BeforeClass (org.testng.annotations.BeforeClass)1 AuthenticatorClient (org.wso2.carbon.integration.common.admin.client.AuthenticatorClient)1 UserManagementClient (org.wso2.identity.integration.common.clients.UserManagementClient)1 RemoteUserStoreManagerServiceClient (org.wso2.identity.integration.common.clients.usermgt.remote.RemoteUserStoreManagerServiceClient)1