From a44665879c68600f145200b99678113f4af47b40 Mon Sep 17 00:00:00 2001 From: sachinisiriwardene Date: Thu, 19 Oct 2023 09:20:58 +0530 Subject: [PATCH] refactor code --- .../oauth2/dcrm/api/OAuthDCRMTestCase.java | 7 +++-- .../scenarios/sso/test/dcr/DCRTestCase.java | 4 +-- .../registration-requests/request3.json | 27 ------------------- .../resources/update-requests/request3.json | 27 ------------------- 4 files changed, 4 insertions(+), 61 deletions(-) delete mode 100644 product-scenarios/4-single-sign-on/4.1-sso-for-web-app/4.1.4-sso-with-oidc/4.1.4.1-dcr/src/test/resources/registration-requests/request3.json delete mode 100644 product-scenarios/4-single-sign-on/4.1-sso-for-web-app/4.1.4-sso-with-oidc/4.1.4.1-dcr/src/test/resources/update-requests/request3.json diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/oauth2/dcrm/api/OAuthDCRMTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/oauth2/dcrm/api/OAuthDCRMTestCase.java index c9733c32fe8..dfb6b46d738 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/oauth2/dcrm/api/OAuthDCRMTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/identity/integration/test/oauth2/dcrm/api/OAuthDCRMTestCase.java @@ -480,8 +480,9 @@ public void testUpdateServiceProviderRequestWithAdditionalParameters() throws Ex updateResponsePayload.remove("client_secret"); updateResponsePayload.remove("client_secret_expires_at"); assertEquals(mapper.readTree(updateResponsePayload.toJSONString()), - mapper.readTree(updateRequestPayload.toJSONString()), - "Response payload should be equal."); + mapper.readTree(updateRequestPayload.toJSONString()), "Response payload should be equal."); + + testDeleteServiceProvider(); } @Test(alwaysRun = true, groups = "wso2.is", priority = 11, @@ -500,7 +501,5 @@ public void validateErrorScenarios(JSONObject requestJSON, String errorCode, Str JSONObject errorResponse = getPayload(response); assertEquals(errorResponse.get("error"), errorCode); assertEquals(errorResponse.get("error_description"), errorMessage); - - // resetISConfiguration(); } } diff --git a/product-scenarios/4-single-sign-on/4.1-sso-for-web-app/4.1.4-sso-with-oidc/4.1.4.1-dcr/src/test/java/org/wso2/identity/scenarios/sso/test/dcr/DCRTestCase.java b/product-scenarios/4-single-sign-on/4.1-sso-for-web-app/4.1.4-sso-with-oidc/4.1.4.1-dcr/src/test/java/org/wso2/identity/scenarios/sso/test/dcr/DCRTestCase.java index 7c4653cad6e..c33c7a6312e 100644 --- a/product-scenarios/4-single-sign-on/4.1-sso-for-web-app/4.1.4-sso-with-oidc/4.1.4.1-dcr/src/test/java/org/wso2/identity/scenarios/sso/test/dcr/DCRTestCase.java +++ b/product-scenarios/4-single-sign-on/4.1-sso-for-web-app/4.1.4-sso-with-oidc/4.1.4.1-dcr/src/test/java/org/wso2/identity/scenarios/sso/test/dcr/DCRTestCase.java @@ -97,9 +97,7 @@ private static Object[][] dcrConfigProvider() throws Exception { }, { getRegisterRequestJSON("request2.json"), getUpdateRequestJSON("request2.json"), ADMIN_USERNAME, ADMIN_PASSWORD, SUPER_TENANT_DOMAIN - }, { - getRegisterRequestJSON("request3.json"), getUpdateRequestJSON("request3.json"), ADMIN_USERNAME, - ADMIN_PASSWORD, SUPER_TENANT_DOMAIN} + } }; } diff --git a/product-scenarios/4-single-sign-on/4.1-sso-for-web-app/4.1.4-sso-with-oidc/4.1.4.1-dcr/src/test/resources/registration-requests/request3.json b/product-scenarios/4-single-sign-on/4.1-sso-for-web-app/4.1.4-sso-with-oidc/4.1.4.1-dcr/src/test/resources/registration-requests/request3.json deleted file mode 100644 index e690a1ab42a..00000000000 --- a/product-scenarios/4-single-sign-on/4.1-sso-for-web-app/4.1.4-sso-with-oidc/4.1.4.1-dcr/src/test/resources/registration-requests/request3.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "client_name": "dcr-app-3", - "redirect_uris": [ - "https://abc/redirect1", - "https://abc/redirect2" - ], - "grant_types": [ - "client_credentials" - ], - "jwks_uri": "https://localhost/jwks", - - "token_endpoint_auth_method": "private_key_jwt", - "token_endpoint_auth_signing_alg" : "PS256", - "sector_identifier_uri" : "https://mocki.io/v1/04b49547-0ae2-4049-8d1c-42648e633001", - "id_token_signed_response_alg" : "PS256", - "id_token_encrypted_response_alg" : "RSA-OAEP", - "id_token_encrypted_response_enc" : "A128GCM", - "authorization_signed_response_alg" : "PS256", - "request_object_signing_alg" : "PS256", - "tls_client_auth_subject_dn" : "dfrrfc", - "require_signed_request_object" : true, - "require_pushed_authorization_requests" : true, - "tls_client_certificate_bound_access_tokens" : true, - "subject_type" : "pairwise", - "request_object_encryption_alg" : "RSA-OAEP", - "request_object_encryption_enc" : "A128GCM" -} \ No newline at end of file diff --git a/product-scenarios/4-single-sign-on/4.1-sso-for-web-app/4.1.4-sso-with-oidc/4.1.4.1-dcr/src/test/resources/update-requests/request3.json b/product-scenarios/4-single-sign-on/4.1-sso-for-web-app/4.1.4-sso-with-oidc/4.1.4.1-dcr/src/test/resources/update-requests/request3.json deleted file mode 100644 index 264c4afb78e..00000000000 --- a/product-scenarios/4-single-sign-on/4.1-sso-for-web-app/4.1.4-sso-with-oidc/4.1.4.1-dcr/src/test/resources/update-requests/request3.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "client_name": "dcr-app-3", - "redirect_uris": [ - "https://abc/redirect1", - "https://abc/redirect2" - ], - "grant_types": [ - "client_credentials" - ], - "jwks_uri": "https://localhost/jwks", - - "token_endpoint_auth_method": "private_key_jwt", - "token_endpoint_auth_signing_alg" : "PS256", - "sector_identifier_uri" : "https://mocki.io/v1/04b49547-0ae2-4049-8d1c-42648e633001", - "id_token_signed_response_alg" : "PS256", - "id_token_encrypted_response_alg" : "RSA-OAEP", - "id_token_encrypted_response_enc" : "A128GCM", - "authorization_signed_response_alg" : "ES256", - "request_object_signing_alg" : "PS256", - "tls_client_auth_subject_dn" : "dfrrfc", - "require_signed_request_object" : true, - "require_pushed_authorization_requests" : true, - "tls_client_certificate_bound_access_tokens" : true, - "subject_type" : "public", - "request_object_encryption_alg" : "RSA-OAEP", - "request_object_encryption_enc" : "A128GCM" -} \ No newline at end of file