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);
}
Aggregations