Skip to content

Commit

Permalink
remove challenge questions related tests
Browse files Browse the repository at this point in the history
  • Loading branch information
asha15 committed Nov 29, 2023
1 parent ba30a94 commit 056e642
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ public class OAuth2ServiceAbstractIntegrationTest extends ISIntegrationTest {
protected static final String EMAIL_CLAIM_URI = "http://wso2.org/claims/emailaddress";
private static final String GIVEN_NAME_CLAIM_URI = "http://wso2.org/claims/givenname";
protected static final String COUNTRY_CLAIM_URI = "http://wso2.org/claims/country";
private static final String customClaimURI1 = "http://wso2.org/claims/challengeQuestion1";
private static final String customClaimURI2 = "http://wso2.org/claims/challengeQuestion2";
private static final String GRANT_TYPE_PASSWORD = "password";
private static final String SCOPE_PRODUCTION = "PRODUCTION";
public static final String OIDC = "oidc";
Expand Down Expand Up @@ -355,12 +353,6 @@ private ClaimConfiguration getClaimConfigurations() {
claimConfiguration.addClaimMappingsItem(getClaimMapping(COUNTRY_CLAIM_URI));
claimConfiguration.addRequestedClaimsItem(getRequestedClaim(COUNTRY_CLAIM_URI));

claimConfiguration.addClaimMappingsItem(getClaimMapping(customClaimURI1));
claimConfiguration.addRequestedClaimsItem(getRequestedClaim(customClaimURI1));

claimConfiguration.addClaimMappingsItem(getClaimMapping(customClaimURI2));
claimConfiguration.addRequestedClaimsItem(getRequestedClaim(customClaimURI2));

return claimConfiguration;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@
import org.wso2.carbon.integration.common.utils.mgt.ServerConfigurationManager;
import org.wso2.identity.integration.test.rest.api.server.application.management.v1.model.ApplicationResponseModel;
import org.wso2.identity.integration.test.rest.api.server.application.management.v1.model.OpenIDConnectConfiguration;
import org.wso2.identity.integration.test.rest.api.server.challenge.v1.model.ServerChallengeModel.Questions;
import org.wso2.identity.integration.test.rest.api.server.challenge.v1.model.UserChallengeAnswer;
import org.wso2.identity.integration.test.rest.api.server.claim.management.v1.model.ExternalClaimReq;
import org.wso2.identity.integration.test.rest.api.user.common.model.Email;
import org.wso2.identity.integration.test.rest.api.user.common.model.ListObject;
Expand All @@ -57,7 +55,6 @@
import org.wso2.identity.integration.test.rest.api.user.common.model.RoleItemAddGroupobj;
import org.wso2.identity.integration.test.rest.api.user.common.model.ScimSchemaExtensionEnterprise;
import org.wso2.identity.integration.test.rest.api.user.common.model.UserObject;
import org.wso2.identity.integration.test.restclients.ChallengeQuestionsRestClient;
import org.wso2.identity.integration.test.restclients.ClaimManagementRestClient;
import org.wso2.identity.integration.test.restclients.SCIM2RestClient;
import org.wso2.identity.integration.test.util.Utils;
Expand All @@ -79,10 +76,6 @@ public class OAuth2ServiceAuthCodeGrantOpenIdRequestObjectTestCase extends OAuth

public static final String ENCODED_OIDC_CLAIM_DIALECT = "aHR0cDovL3dzbzIub3JnL29pZGMvY2xhaW0";
private static final String USERS_PATH = "users";
private static final String CHALLENGE_QUESTION_SET_ID1 = "challengeQuestion1";
private static final String CHALLENGE_QUESTION_SET_ID2 = "challengeQuestion2";
private static final String CHALLENGE_QUESTION_SET1_Q1 = "City where you were born ?";
private static final String CHALLENGE_QUESTION_SET2_Q1 = "Model of your first car ?";
private static final String LOCALE = "en_US";
private ServerConfigurationManager serverConfigurationManager;

Expand All @@ -104,8 +97,6 @@ public class OAuth2ServiceAuthCodeGrantOpenIdRequestObjectTestCase extends OAuth
private static final String emailClaimURI = "http://wso2.org/claims/emailaddress";
private static final String givenNameClaimURI = "http://wso2.org/claims/givenname";
private static final String countryClaimURI = "http://wso2.org/claims/country";
private static final String customClaimURI1 = "http://wso2.org/claims/challengeQuestion1";
private static final String customClaimURI2 = "http://wso2.org/claims/challengeQuestion2";
private static final String externalClaimURI1 = "externalClaim1";
private static final String externalClaimURI2 = "externalClaim2";
private static final String USER_EMAIL = "abcrqo@wso2.com";
Expand All @@ -126,7 +117,6 @@ public class OAuth2ServiceAuthCodeGrantOpenIdRequestObjectTestCase extends OAuth

private SCIM2RestClient scim2RestClient;
private ClaimManagementRestClient claimManagementRestClient;
private ChallengeQuestionsRestClient challengeQuestionsRestClient;

private String applicationId;
private String userId;
Expand Down Expand Up @@ -165,12 +155,9 @@ public void testInit() throws Exception {
setSystemproperties();

scim2RestClient = new SCIM2RestClient(serverURL, tenantInfo);
challengeQuestionsRestClient = new ChallengeQuestionsRestClient(serverURL, tenantInfo);
claimManagementRestClient = new ClaimManagementRestClient(serverURL, tenantInfo);

addAdminUser();
claimId1 = addOIDCClaims(externalClaimURI1, customClaimURI1);
claimId2 = addOIDCClaims(externalClaimURI2, customClaimURI2);

}

Expand All @@ -195,7 +182,6 @@ public void atEnd() throws Exception {
restClient.closeHttpClient();
scim2RestClient.closeHttpClient();
claimManagementRestClient.closeHttpClient();
challengeQuestionsRestClient.closeHttpClient();
client.close();
}

Expand Down Expand Up @@ -448,16 +434,5 @@ private void addAdminUser() throws Exception {
patchRoleItem.addValue(new ListObject().value(userId));

scim2RestClient.updateUserRole(new PatchOperationRequestObject().addOperations(patchRoleItem), roleId);

setChallengeQuestion(CHALLENGE_QUESTION_SET_ID1, CHALLENGE_QUESTION_SET1_Q1, CUSTOM_CLAIM1);
setChallengeQuestion(CHALLENGE_QUESTION_SET_ID2, CHALLENGE_QUESTION_SET2_Q1, CUSTOM_CLAIM2);
}

private void setChallengeQuestion(String questionSetId, String question, String answer) throws Exception {
UserChallengeAnswer challengeQuestionObj = new UserChallengeAnswer();
challengeQuestionObj.setChallengeQuestion(new Questions(LOCALE, question, null));
challengeQuestionObj.setAnswer(answer);

challengeQuestionsRestClient.setChallengeQuestionAnswer(userId, questionSetId, challengeQuestionObj);
}
}

0 comments on commit 056e642

Please sign in to comment.