From 50daf9d07bc40bb67207a1e09d3240b6b7fa0196 Mon Sep 17 00:00:00 2001 From: Likhitha R L Date: Mon, 29 Jul 2024 17:31:50 +0530 Subject: [PATCH 01/10] negative testcase Signed-off-by: Likhitha R L --- .../main/resources/config/Kernel.properties | 56 +++--- .../resources/pms/OIDCClient/OIDCClient.yml | 189 ++++++++++++++++++ .../pms/PublishPolicy/PublishPolicy.yml | 136 ++++++++++++- .../UpdatePolicyStatus/UpdatePolicyStatus.yml | 123 +++++++++++- .../UploadCACertificate.yml | 51 +++++ .../UploadPartnerCert/UploadPartnerCert.yml | 64 +++++- apitest/src/main/resources/pms/error.hbs | 10 + .../partnerPolicyMapping.yml | 63 +++++- 8 files changed, 660 insertions(+), 32 deletions(-) create mode 100644 apitest/src/main/resources/pms/error.hbs diff --git a/apitest/src/main/resources/config/Kernel.properties b/apitest/src/main/resources/config/Kernel.properties index 9e0b2e7b73..7e366121e6 100644 --- a/apitest/src/main/resources/config/Kernel.properties +++ b/apitest/src/main/resources/config/Kernel.properties @@ -136,17 +136,17 @@ AuthClientID = mosip-resident-client #---------------------------------- Client Secret Keys -----------------------# #-- When test rig ran in docker, these values dervied from the environment ---# -mosip_partner_client_secret = -mosip_pms_client_secret = -mosip_resident_client_secret = -mosip_idrepo_client_secret = -mosip_reg_client_secret = -mosip_admin_client_secret = -mosip_hotlist_client_secret = -mosip_regproc_client_secret = -mpartner_default_mobile_secret = -mosip_testrig_client_secret = -AuthClientSecret = +mosip_partner_client_secret = vXS7WUyPDpfWYuoz +mosip_pms_client_secret = qG3eE2aRzbIwLX01 +mosip_resident_client_secret = N4xRICdDT4HYvo21 +mosip_idrepo_client_secret = oQXHRL4UsgKxlVaU +mosip_reg_client_secret = bCR3Xviw9EPPlpUv +mosip_admin_client_secret = uuQoXFn2FT5OKMOr +mosip_hotlist_client_secret = Gh0VQLBVAagN1qrD +mosip_regproc_client_secret = rOE0Tx44C4HJ05qi +mpartner_default_mobile_secret = WqzUI7CYDXw6DVTV +mosip_testrig_client_secret = XfrFYmV9ENVXGDUq +AuthClientSecret = N4xRICdDT4HYvo21 @@ -158,7 +158,7 @@ s3-account = automation s3-region = null reportExpirationInDays = 3 s3-account-for-persona-data = personaData -push-reports-to-s3 = yes +push-reports-to-s3 = no #-------------------- Keycloak User Creation proprties ----------------------# @@ -168,17 +168,17 @@ new_Resident_Password = mosip123 new_Resident_Role = default-roles-mosip,PARTNER_ADMIN roles.111995 = PARTNER_ADMIN,default-roles-mosip keycloak_UserName = admin -keycloak_Password = -keycloak-external-url = https://iam.qa-platform1.mosip.net +keycloak_Password = 3Bj8VPUruV +keycloak-external-url = https://iam.dev1.mosip.net keycloak-realm-id = mosip -iam-users-to-create = 111997,111998,220005,111992,globaladmin,111887,111999 -iam-users-password = mosip123,mosip123,mosip123,mosip123,mosip123,mosip123,mosip123 -roles.220005 = GLOBAL_ADMIN,ID_AUTHENTICATION,REGISTRATION_ADMIN,REGISTRATION_SUPERVISOR,ZONAL_ADMIN -roles.111997 = AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,POLICYMANAGER,REGISTRATION_SUPERVISOR -roles.111887 = AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,REGISTRATION_SUPERVISOR -roles.111998 = POLICYMANAGER -roles.111992 = GLOBAL_ADMIN +iam-users-to-create=111997,111998,220005,111992,globaladmin,111999,111887 +iam-users-password=mosip123,mosip123,mosip123,mosip123,mosip123,mosip123,mosip123 +roles.220005=GLOBAL_ADMIN,ID_AUTHENTICATION,REGISTRATION_ADMIN,REGISTRATION_SUPERVISOR,ZONAL_ADMIN +roles.111997=AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,POLICYMANAGER,REGISTRATION_SUPERVISOR roles.111999=AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,POLICYMANAGER,REGISTRATION_SUPERVISOR +roles.111887=AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,REGISTRATION_SUPERVISOR +roles.111998=POLICYMANAGER +roles.111992=GLOBAL_ADMIN roles.globaladmin = GLOBAL_ADMIN,REGISTRATION_ADMIN,uma_authorization,ZONAL_ADMIN,default-roles-mosip @@ -189,27 +189,27 @@ pool_size=1 dialect=org.hibernate.dialect.PostgreSQLDialect show_sql=true current_session_context_class=thread -audit_url=jdbc:postgresql://qa-platform1.mosip.net:5432/mosip_audit +audit_url=jdbc:postgresql://dev1.mosip.net:5432/mosip_audit audit_username=postgres -audit_password= +audit_password=aRWP1G52uu audit_default_schema=audit DB_PORT= installation-domain= -partner_url=jdbc:postgresql://qa-platform1.mosip.net:5432/mosip_ida +partner_url=jdbc:postgresql://dev1.mosip.net:5432/mosip_ida partner_username=postgres -partner_password= +partner_password=aRWP1G52uu partner_default_schema=partner reportLogPath=automationLogAndReport postgresqlUser=postgresql db-port=5432 -db-server=qa-platform1.mosip.net +db-server=dev1.mosip.net hibernate.connection.driver_class=org.postgresql.Driver hibernate.connection.pool_size=1 hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect hibernate.show_sql=true hibernate.current_session_context_class=thread db-su-user=postgres -postgres-password= +postgres-password=aRWP1G52uu pms_db_schema=pms km_db_schema=keymgr master_db_schema=master @@ -226,7 +226,7 @@ mountPath=/home/mosip/mountvolume # supported values "S-scnearioNumber" for server side and "A-scnearioNumber" for automation scenariosToSkip= # Add scenarios to include in the the execution list -# if we want to execute all the scenarios--- +# Empty if we want to execute all the scenarios--- scenariosToExecute= # supported values yes or no useExternalScenarioSheet=yes diff --git a/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml b/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml index e84f3068ed..5d67a30b8a 100644 --- a/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml +++ b/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml @@ -20,4 +20,193 @@ CreateOIDCClient: output: '{ "clientId": "$IGNORE$", "status": "ACTIVE" +}' + Pms_CreateOIDCClient_invalid_policyID: + endPoint: /v1/partnermanager/oauth/client + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/OIDCClient/oIDCClient + outputTemplate: pms/error + input: '{ + "requestTime": "$TIMESTAMP$", + "name": "OIDC TEST CLIENT 89767", + "policyId": "fgdggh", + "publicKey": "$JWKKEY$", + "authPartnerId": "111999", + "logoUri": "https://health-services.com/logo.png", + "redirectUris": "$IDPREDIRECTURI$", + "grantTypes": "authorization_code", + "clientAuthMethods": "private_key_jwt" +}' + output: '{ + "errorCode": "PMS_PRT_073" +}' + Pms_CreateOIDCClient_invalid_logoUri: + endPoint: /v1/partnermanager/oauth/client + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/OIDCClient/oIDCClient + outputTemplate: pms/error + input: '{ + "requestTime": "$TIMESTAMP$", + "name": "OIDC TEST CLIENT 89766", + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "publicKey": "$JWKKEY$", + "authPartnerId": "111999", + "logoUri": "https://", + "redirectUris": "$IDPREDIRECTURI$", + "grantTypes": "authorization_code", + "clientAuthMethods": "private_key_jwt" +}' + output: '{ + "errorCode": "PMS_COR_001" +}' + Pms_CreateOIDCClient_invalid_RedirectUri: + endPoint: /v1/partnermanager/oauth/client + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/OIDCClient/oIDCClient + outputTemplate: pms/error + input: '{ + "requestTime": "$TIMESTAMP$", + "name": "OIDC TEST CLIENT 89766", + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "publicKey": "$JWKKEY$", + "authPartnerId": "111999", + "logoUri": "https://health-services.com/logo.png", + "redirectUris": "$abcdefg", + "grantTypes": "authorization_code", + "clientAuthMethods": "private_key_jwt" +}' + output: '{ + "errorCode": "invalid_redirect_uri" +}' + Pms_CreateOIDCClient_without_token: + endPoint: /v1/partnermanager/oauth/client + role: + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/OIDCClient/oIDCClient + outputTemplate: pms/error + input: '{ + "requestTime": "$TIMESTAMP$", + "name": "OIDC TEST CLIENT 89766", + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "publicKey": "$JWKKEY$", + "authPartnerId": "111999", + "logoUri": "https://health-services.com/logo.png", + "redirectUris": "$IDPREDIRECTURI$", + "grantTypes": "authorization_code", + "clientAuthMethods": "private_key_jwt" +}' + output: '{ + "errorCode": "KER-ATH-401" +}' + Pms_CreateOIDCClient_without_publickey: + endPoint: /v1/partnermanager/oauth/client + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/OIDCClient/oIDCClient + outputTemplate: pms/error + input: '{ + "requestTime": "$TIMESTAMP$", + "name": "OIDC TEST CLIENT 89766", + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "publicKey": "$REMOVE$", + "authPartnerId": "111999", + "logoUri": "https://health-services.com/logo.png", + "redirectUris": "$IDPREDIRECTURI$", + "grantTypes": "authorization_code", + "clientAuthMethods": "private_key_jwt" +}' + output: '{ + "errorCode": "PMS_COR_00" +}' + Pms_CreateOIDCClient_invalid_granttypes: + endPoint: /v1/partnermanager/oauth/client + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/OIDCClient/oIDCClient + outputTemplate: pms/error + input: '{ + "requestTime": "$TIMESTAMP$", + "name": "OIDC TEST CLIENT 89766", + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "publicKey": "$JWKKEY$", + "authPartnerId": "111999", + "logoUri": "https://health-services.com/logo.png", + "redirectUris": "$IDPREDIRECTURI$", + "grantTypes": "hghghgg", + "clientAuthMethods": "private_key_jwt" +}' + output: '{ + "errorCode": "invalid_grant_type" +}' + Pms_CreateOIDCClient_without_granttypes: + endPoint: /v1/partnermanager/oauth/client + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/OIDCClient/oIDCClient + outputTemplate: pms/error + input: '{ + "requestTime": "$TIMESTAMP$", + "name": "OIDC TEST CLIENT 89766", + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "publicKey": "$JWKKEY$", + "authPartnerId": "111999", + "logoUri": "https://health-services.com/logo.png", + "redirectUris": "$IDPREDIRECTURI$", + "grantTypes": "$REMOVE$", + "clientAuthMethods": "private_key_jwt" +}' + output: '{ + "errorCode": "PMS_COR_001" +}' + Pms_CreateOIDCClient_without_name: + endPoint: /v1/partnermanager/oauth/client + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/OIDCClient/oIDCClient + outputTemplate: pms/error + input: '{ + "requestTime": "$TIMESTAMP$", + "name": "$REMOVE$", + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "publicKey": "$JWKKEY$", + "authPartnerId": "111999", + "logoUri": "https://health-services.com/logo.png", + "redirectUris": "$IDPREDIRECTURI$", + "grantTypes": "authorization_code", + "clientAuthMethods": "private_key_jwt" +}' + output: '{ + "errorCode": "PMS_COR_001" +}' + Pms_CreateOIDCClient_invalid_publickey: + endPoint: /v1/partnermanager/oauth/client + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/OIDCClient/oIDCClient + outputTemplate: pms/error + input: '{ + "requestTime": "$TIMESTAMP$", + "name": "OIDC TEST CLIENT 89766", + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "publicKey": "dhghfgfyt", + "authPartnerId": "111999", + "logoUri": "https://health-services.com/logo.png", + "redirectUris": "$IDPREDIRECTURI$", + "grantTypes": "authorization_code", + "clientAuthMethods": "private_key_jwt" +}' + output: '{ + "errorCode": "PMS_COR_001" }' \ No newline at end of file diff --git a/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml b/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml index b95defc165..723d286d9e 100644 --- a/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml +++ b/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml @@ -25,4 +25,138 @@ createPublishPolicy: "mandatory": "$IGNORE$", "attributeName": "$IGNORE$", "authTokenType": "$IGNORE$" - }' \ No newline at end of file + }' + + Pms_PublishPolicy_WIthRandomToken_Smoke: + endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/PublishPolicy/publishPolicy + outputTemplate: pms/PublishPolicy/publishPolicyResult + input: '{ + "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_pms_sid_id$", + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "requesttime": "$TIMESTAMP$" +}' + output: '{ + "policyGroupName": "$IGNORE$", + "policyGroupDesc": "$IGNORE$", + "policyGroupStatus": true, + "policyName": "$IGNORE$", + "policyDesc": "$IGNORE$", + "policyType": "Auth", + "status": "PUBLISHED", + "is_Active": true, + "authType": "$IGNORE$", + "authSubType": "$IGNORE$", + "mandatory": "$IGNORE$", + "attributeName": "$IGNORE$", + "authTokenType": "random" + }' + + Pms_PublishPolicy_Datashare_Smoke: + endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/PublishPolicy/publishPolicy + outputTemplate: pms/PublishPolicy/publishPolicyResult + input: '{ + "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_pms_sid_id$", + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "requesttime": "$TIMESTAMP$" +}' + output: '{ + "policyGroupName": "mosip policy group", + "policyGroupDesc": "desc mosip policy group updated", + "policyGroupStatus": true, + "is_Active": true + }' + + Pms_PublishPolicy_InValid_AlreadyPublished: + endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/PublishPolicy/publishPolicy + outputTemplate: pms/error + input: '{ + "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_pms_sid_id$", + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "requesttime": "$TIMESTAMP$" +}' + output: '{ + "errors": [ + { + "errorCode": "PMS_POL_020" + } + ] + }' + + Pms_PublishPolicy_InValid_policygroupId: + endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/PublishPolicy/publishPolicy + outputTemplate: pms/error + input: '{ + "policygroupId": "sgdasfgbv", + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "requesttime": "$TIMESTAMP$" +}' + output: '{ + "errors": [ + { + "errorCode": "PMS_POL_016" + } + ] + }' + + Pms_PublishPolicy_InValid_policygroupId: + endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/PublishPolicy/publishPolicy + outputTemplate: pms/error + input: '{ + "policygroupId": "sgdasfgbv", + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "requesttime": "$TIMESTAMP$" +}' + output: '{ + "errors": [ + { + "errorCode": "PMS_POL_016" + } + ] + }' + + Pms_PublishPolicy_InValid_policyId: + endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/PublishPolicy/publishPolicy + outputTemplate: pms/error + input: '{ + "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_sid_id$", + "policyId": "afgrwfg", + "requesttime": "$TIMESTAMP$" +}' + output: '{ + "errors": [ + { + "errorCode": "PMS_POL_008" + } + ] + }' + + + + + + + \ No newline at end of file diff --git a/apitest/src/main/resources/pms/UpdatePolicyStatus/UpdatePolicyStatus.yml b/apitest/src/main/resources/pms/UpdatePolicyStatus/UpdatePolicyStatus.yml index 166b399579..e81f86f079 100644 --- a/apitest/src/main/resources/pms/UpdatePolicyStatus/UpdatePolicyStatus.yml +++ b/apitest/src/main/resources/pms/UpdatePolicyStatus/UpdatePolicyStatus.yml @@ -13,4 +13,125 @@ UpdatePolicyStatus: }' output: ' { "message": "status updated successfully" - }' \ No newline at end of file + }' + + Pms_UpdatePolicyStatus_DeActive_auth_All_Valid_Smoke: + endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId} + role: partnerrevamp + restMethod: patch + inputTemplate: pms/UpdatePolicyStatus/updatePolicyStatus + outputTemplate: pms/UpdatePolicyStatus/updatePolicyStatusResult + input: '{ + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "policygroupId":"$ID:DefinePolicyGroup_All_Valid_Smoke_pms_sid_id$", + "status":"De-Active", + "requesttime": "$TIMESTAMP$" +}' + output: ' { + "message": "status updated successfully" + }' + + Pms_UpdatePolicyStatus_Active_InValid: + endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId} + role: partnerrevamp + restMethod: patch + inputTemplate: pms/UpdatePolicyStatus/updatePolicyStatus + outputTemplate: pms/error + input: '{ + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "policygroupId":"$ID:DefinePolicyGroup_All_Valid_Smoke_pms_sid_id$", + "status":"De-Active", + "requesttime": "$TIMESTAMP$" +}' + output: ' { + "errors": [ + { + "errorCode": "PMS_POL_054", + "message": "Cannot activate unpublished policy." + } + ] + }' + + Pms_UpdatePolicyStatus_PolicyId_InValid: + endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId} + role: partnerrevamp + restMethod: patch + inputTemplate: pms/UpdatePolicyStatus/updatePolicyStatus + outputTemplate: pms/error + input: '{ + "policyId": "asfgv", + "policygroupId":"$ID:DefinePolicyGroup_All_Valid_Smoke_pms_sid_id$", + "status":"De-Active", + "requesttime": "$TIMESTAMP$" +}' + output: ' { + "errors": [ + { + "errorCode": "PMS_POL_008", + "message": "Policy ID does not exist" + } + ] + }' + + Pms_UpdatePolicyStatus_status_InValid: + endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId} + role: partnerrevamp + restMethod: patch + inputTemplate: pms/UpdatePolicyStatus/updatePolicyStatus + outputTemplate: pms/error + input: '{ + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "policygroupId":"$ID:DefinePolicyGroup_All_Valid_Smoke_pms_sid_id$", + "status":"asfg", + "requesttime": "$TIMESTAMP$" +}' + output: ' { + "errors": [ + { + "errorCode": "PMS_POL_045", + "message": "Policy Status either Active or De-active." + } + ] + }' + + Pms_UpdatePolicyStatus_PolicyGroupId_InValid: + endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId} + role: partnerrevamp + restMethod: patch + inputTemplate: pms/UpdatePolicyStatus/updatePolicyStatus + outputTemplate: pms/error + input: '{ + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "policygroupId":"asfbvef", + "status":"Active", + "requesttime": "$TIMESTAMP$" +}' + output: ' { + "errors": [ + { + "errorCode": "PMS_POL_016", + "message": "Policy Group ID does not exist" + } + ] + }' + + Pms_UpdatePolicyStatus_Missing_status_InValid: + endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId} + role: partnerrevamp + restMethod: patch + inputTemplate: pms/UpdatePolicyStatus/updatePolicyStatus + outputTemplate: pms/error + input: '{ + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "policygroupId":"asfbvef", + "status":"$REMOVE$", + "requesttime": "$TIMESTAMP$" +}' + output: ' { + "errors": [ + { + "errorCode": "PMS_COR_003", + "message": "Could not process the request" + } + ] + }' \ No newline at end of file diff --git a/apitest/src/main/resources/pms/UploadCACertificate/UploadCACertificate.yml b/apitest/src/main/resources/pms/UploadCACertificate/UploadCACertificate.yml index b96e99a7fa..12b7dbba90 100644 --- a/apitest/src/main/resources/pms/UploadCACertificate/UploadCACertificate.yml +++ b/apitest/src/main/resources/pms/UploadCACertificate/UploadCACertificate.yml @@ -22,4 +22,55 @@ UploadCACertificate: "requesttime": "$TIMESTAMP$" }' output: ' { +}' + Pms_UploadSubCACertificate_UploadAgain_All_Valid_Smoke: + endPoint: /v1/partnermanager/partners/certificate/ca/upload + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/UploadCACertificate/uploadCertificate2 + outputTemplate: pms/error + input: '{ + "requesttime": "$TIMESTAMP$" + }' + output: ' { + "errors": [ + { + "errorCode": "KER-PCM-003" + } + ] +}' + Pms_UploadSubCACertificate_with_invalid_data: + endPoint: /v1/partnermanager/partners/certificate/ca/upload + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/UploadCACertificate/uploadCertificate3 + outputTemplate: pms/error + input: '{ + "requesttime": "$TIMESTAMP$" + }' + output: ' { + "errors": [ + { + "errorCode": "KER-CRY-003" + } + ] +}' + Pms_UploadSubCACertificate_with_blank_data: + endPoint: /v1/partnermanager/partners/certificate/ca/upload + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/UploadCACertificate/uploadCertificate4 + outputTemplate: pms/error + input: '{ + "requesttime": "$TIMESTAMP$" + }' + output: ' { + "errors": [ + { + "errorCode": "PMS_COR_001" + } + ] }' \ No newline at end of file diff --git a/apitest/src/main/resources/pms/UploadPartnerCert/UploadPartnerCert.yml b/apitest/src/main/resources/pms/UploadPartnerCert/UploadPartnerCert.yml index 09b9d20619..a7fe13831d 100644 --- a/apitest/src/main/resources/pms/UploadPartnerCert/UploadPartnerCert.yml +++ b/apitest/src/main/resources/pms/UploadPartnerCert/UploadPartnerCert.yml @@ -10,4 +10,66 @@ uploadPartnerCert: "requesttime": "$TIMESTAMP$" }' output: ' { -}' \ No newline at end of file +}' + Pms_UploadPartnerCert_missing_PartnerDomain: + endPoint: /v1/partnermanager/partners/certificate/upload + role: partnerrevamp + restMethod: post + inputTemplate: pms/UploadPartnerCert/uploadCert2 + outputTemplate: pms/error + input: '{ + "requesttime": "$TIMESTAMP$" +}' + output: ' { + "errors": [ + { + "errorCode": "PMS_COR_001" + } + ] +}' + Pms_UploadPartnerCert_invalid_certificate: + endPoint: /v1/partnermanager/partners/certificate/upload + role: partnerrevamp + restMethod: post + inputTemplate: pms/UploadPartnerCert/uploadCert3 + outputTemplate: pms/error + input: '{ + "requesttime": "$TIMESTAMP$" +}' + output: ' { + "errors": [ + { + "errorCode": "KER-KMS-013" + } + ] +}' + Pms_UploadPartnerCert_invalid_Domain: + endPoint: /v1/partnermanager/partners/certificate/upload + role: partnerrevamp + restMethod: post + inputTemplate: pms/UploadPartnerCert/uploadCert4 + outputTemplate: pms/error + input: '{ + "requesttime": "$TIMESTAMP$" +}' + output: ' { + "errors": [ + { + "errorCode": "KER-PCM-011" + } + ] +}' + Pms_UploadPartnerCert_UploadAgain_All_Valid_Smoke: + endPoint: /v1/partnermanager/partners/certificate/upload + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/UploadPartnerCert/uploadCert + outputTemplate: pms/UploadPartnerCert/uploadCertResult + input: '{ + "requesttime": "$TIMESTAMP$" +}' + output: ' { +}' + + \ No newline at end of file diff --git a/apitest/src/main/resources/pms/error.hbs b/apitest/src/main/resources/pms/error.hbs new file mode 100644 index 0000000000..f4bcb6bee6 --- /dev/null +++ b/apitest/src/main/resources/pms/error.hbs @@ -0,0 +1,10 @@ +{ + "errors": [ + {{#each errors}} + { + "errorCode": "{{errorCode}}" + } + {{#unless @last}},{{/unless}} + {{/each}} + ] +} \ No newline at end of file diff --git a/apitest/src/main/resources/pms/partnerPolicyMapping/partnerPolicyMapping.yml b/apitest/src/main/resources/pms/partnerPolicyMapping/partnerPolicyMapping.yml index 0b1ae7423a..7c06dd125e 100644 --- a/apitest/src/main/resources/pms/partnerPolicyMapping/partnerPolicyMapping.yml +++ b/apitest/src/main/resources/pms/partnerPolicyMapping/partnerPolicyMapping.yml @@ -12,4 +12,65 @@ partnerPolicyMapping: "requesttime": "$TIMESTAMP$" }' output: '{ - }' \ No newline at end of file + }' + + Pms_partnerPolicyMapping_invalid_policyName: + endPoint: /v1/partnermanager/partners/111999/policy/map + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/partnerPolicyMapping/partnerPolicyMapping + outputTemplate: pms/error + input: '{ + "policyName": "%^776hfgsdf", + "useCaseDescription": "Need to submit the payment", + "requesttime": "$TIMESTAMP$" + }' + output: '{ + "errorCode": "PMS_PRT_073" + }' + Pms_partnerPolicyMapping_invalid_partnerId: + endPoint: /v1/partnermanager/partners/1hhggg9/policy/map + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/partnerPolicyMapping/partnerPolicyMapping + outputTemplate: pms/error + input: '{ + "policyName": "mosip policy 19234", + "useCaseDescription": "Need to submit the payment", + "requesttime": "$TIMESTAMP$" + }' + output: '{ + "errorCode": "PMS_PRT_005" + }' + Pms_partnerPolicyMapping_missing_policyName: + endPoint: /v1/partnermanager/partners/111999/policy/map + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/partnerPolicyMapping/partnerPolicyMapping + outputTemplate: pms/error + input: '{ + "policyName": "$REMOVE$", + "useCaseDescription": "Need to submit the payment", + "requesttime": "$TIMESTAMP$" + }' + output: '{ + "errorCode": "PMS_COR_001" + }' + Pms_partnerPolicyMapping_missing_useCaseDescription: + endPoint: /v1/partnermanager/partners/111999/policy/map + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: post + inputTemplate: pms/partnerPolicyMapping/partnerPolicyMapping + outputTemplate: pms/error + input: '{ + "policyName": "mosip policy 19234", + "useCaseDescription": "$REMOVE$", + "requesttime": "$TIMESTAMP$" + }' + output: '{ + "errorCode": "PMS_COR_001" + }' \ No newline at end of file From 718968492e8b1e38ad50b1f8158090c5abcb111b Mon Sep 17 00:00:00 2001 From: Likhitha R L Date: Tue, 30 Jul 2024 17:00:10 +0530 Subject: [PATCH 02/10] negative testcases Signed-off-by: Likhitha R L --- .../pms/PublishPolicy/PublishPolicy.yml | 48 +++++------------ .../UpdatePolicyStatus/UpdatePolicyStatus.yml | 6 +-- .../VerifyPartnersEmail.yml | 54 ++++++++++++++++++- 3 files changed, 68 insertions(+), 40 deletions(-) diff --git a/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml b/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml index 723d286d9e..ab8c2bfacc 100644 --- a/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml +++ b/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml @@ -54,26 +54,7 @@ createPublishPolicy: "attributeName": "$IGNORE$", "authTokenType": "random" }' - - Pms_PublishPolicy_Datashare_Smoke: - endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish - role: partnerrevamp - checkErrorsOnlyInResponse: true - restMethod: post - inputTemplate: pms/PublishPolicy/publishPolicy - outputTemplate: pms/PublishPolicy/publishPolicyResult - input: '{ - "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_pms_sid_id$", - "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", - "requesttime": "$TIMESTAMP$" -}' - output: '{ - "policyGroupName": "mosip policy group", - "policyGroupDesc": "desc mosip policy group updated", - "policyGroupStatus": true, - "is_Active": true - }' - + Pms_PublishPolicy_InValid_AlreadyPublished: endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish role: partnerrevamp @@ -114,7 +95,7 @@ createPublishPolicy: ] }' - Pms_PublishPolicy_InValid_policygroupId: + Pms_PublishPolicy_InValid_policyId: endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish role: partnerrevamp checkErrorsOnlyInResponse: true @@ -122,41 +103,36 @@ createPublishPolicy: inputTemplate: pms/PublishPolicy/publishPolicy outputTemplate: pms/error input: '{ - "policygroupId": "sgdasfgbv", - "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_sid_id$", + "policyId": "afgrwfg", "requesttime": "$TIMESTAMP$" }' output: '{ "errors": [ { - "errorCode": "PMS_POL_016" + "errorCode": "PMS_POL_008" } ] }' - - Pms_PublishPolicy_InValid_policyId: + Pms_PublishPolicy_missing_token: endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish - role: partnerrevamp + role: checkErrorsOnlyInResponse: true restMethod: post inputTemplate: pms/PublishPolicy/publishPolicy outputTemplate: pms/error input: '{ - "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_sid_id$", - "policyId": "afgrwfg", + "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_pms_sid_id$", + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", "requesttime": "$TIMESTAMP$" }' output: '{ "errors": [ { - "errorCode": "PMS_POL_008" + "errorCode": "PMS_POL_020" } ] - }' - - - - - + }' + \ No newline at end of file diff --git a/apitest/src/main/resources/pms/UpdatePolicyStatus/UpdatePolicyStatus.yml b/apitest/src/main/resources/pms/UpdatePolicyStatus/UpdatePolicyStatus.yml index e81f86f079..17adb58926 100644 --- a/apitest/src/main/resources/pms/UpdatePolicyStatus/UpdatePolicyStatus.yml +++ b/apitest/src/main/resources/pms/UpdatePolicyStatus/UpdatePolicyStatus.yml @@ -1,5 +1,5 @@ UpdatePolicyStatus: - Pms_UpdatePolicyStatus_DeActive_auth_All_Valid_Smoke: + Pms_UpdatePolicyStatus_Active_auth_All_Valid_Smoke: endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId} role: partnerrevamp restMethod: patch @@ -123,7 +123,7 @@ UpdatePolicyStatus: outputTemplate: pms/error input: '{ "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", - "policygroupId":"asfbvef", + "policygroupId":"$ID:DefinePolicyGroup_All_Valid_Smoke_pms_sid_id$", "status":"$REMOVE$", "requesttime": "$TIMESTAMP$" }' @@ -134,4 +134,4 @@ UpdatePolicyStatus: "message": "Could not process the request" } ] - }' \ No newline at end of file + }' \ No newline at end of file diff --git a/apitest/src/main/resources/pms/VerifyPartnersEmail/VerifyPartnersEmail.yml b/apitest/src/main/resources/pms/VerifyPartnersEmail/VerifyPartnersEmail.yml index 7b009660e6..1af26b8f2a 100644 --- a/apitest/src/main/resources/pms/VerifyPartnersEmail/VerifyPartnersEmail.yml +++ b/apitest/src/main/resources/pms/VerifyPartnersEmail/VerifyPartnersEmail.yml @@ -11,4 +11,56 @@ VerifyPartnersEmail: }' output: '{ "emailExists": true -}' \ No newline at end of file +}' + Pms_VerifyPartnersEmail_without_token: + endPoint: /v1/partnermanager/partners/email/verify + role: + restMethod: put + inputTemplate: pms/VerifyPartnersEmail/verifyPartnersEmail + outputTemplate: pms/error + input: '{ + "emailId": "mosip98763@gmail.com", + "requesttime": "$TIMESTAMP$" +}' + output: '{ + "errors": [ + { + "errorCode": "KER-ATH-401" + } + ] +}' + Pms_VerifyPartnersEmail_missing_email: + endPoint: /v1/partnermanager/partners/email/verify + role: partnerrevamp + restMethod: put + inputTemplate: pms/VerifyPartnersEmail/verifyPartnersEmail + outputTemplate: pms/error + input: '{ + "emailId": "$REMOVE$", + "requesttime": "$TIMESTAMP$" +}' + output: '{ + "errors": [ + { + "errorCode": null + } + ] +}' + Pms_VerifyPartnersEmail_invalid_email: + endPoint: /v1/partnermanager/partners/email/verify + role: partnerrevamp + restMethod: put + inputTemplate: pms/VerifyPartnersEmail/verifyPartnersEmail + outputTemplate: pms/error + input: '{ + "emailId": "gfhgytth", + "requesttime": "$TIMESTAMP$" +}' + output: '{ + "errors": [ + { + "errorCode": "PMS_PRT_012" + } + ] +}' + From f1d2470bdec2e98bd8ed00c90c4c25414b82e9ae Mon Sep 17 00:00:00 2001 From: Likhitha R L Date: Mon, 5 Aug 2024 18:41:13 +0530 Subject: [PATCH 03/10] Negative Testcases Signed-off-by: Likhitha R L --- .../resources/pms/OIDCClient/OIDCClient.yml | 54 +++++++++++++++---- .../pms/OIDCClient/UpdateOIDCClient.yml | 2 +- .../UpdatePolicyStatus/UpdatePolicyStatus.yml | 9 ++-- .../VerifyPartnersEmail.yml | 2 +- .../partnerPolicyMapping.yml | 18 +++++-- 5 files changed, 65 insertions(+), 20 deletions(-) diff --git a/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml b/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml index 5d67a30b8a..12aff13ed9 100644 --- a/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml +++ b/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml @@ -40,7 +40,11 @@ CreateOIDCClient: "clientAuthMethods": "private_key_jwt" }' output: '{ - "errorCode": "PMS_PRT_073" + "errors": [ + { + "errorCode": "PMS_PRT_073" + } + ] }' Pms_CreateOIDCClient_invalid_logoUri: endPoint: /v1/partnermanager/oauth/client @@ -61,7 +65,11 @@ CreateOIDCClient: "clientAuthMethods": "private_key_jwt" }' output: '{ - "errorCode": "PMS_COR_001" + "errors": [ + { + "errorCode": "PMS_COR_001" + } + ] }' Pms_CreateOIDCClient_invalid_RedirectUri: endPoint: /v1/partnermanager/oauth/client @@ -82,7 +90,11 @@ CreateOIDCClient: "clientAuthMethods": "private_key_jwt" }' output: '{ - "errorCode": "invalid_redirect_uri" + "errors": [ + { + "errorCode": "invalid_redirect_uri" + } + ] }' Pms_CreateOIDCClient_without_token: endPoint: /v1/partnermanager/oauth/client @@ -103,7 +115,11 @@ CreateOIDCClient: "clientAuthMethods": "private_key_jwt" }' output: '{ - "errorCode": "KER-ATH-401" + "errors": [ + { + "errorCode": "KER-ATH-401" + } + ] }' Pms_CreateOIDCClient_without_publickey: endPoint: /v1/partnermanager/oauth/client @@ -124,7 +140,11 @@ CreateOIDCClient: "clientAuthMethods": "private_key_jwt" }' output: '{ - "errorCode": "PMS_COR_00" + "errors": [ + { + "errorCode": "PMS_COR_00" + } + ] }' Pms_CreateOIDCClient_invalid_granttypes: endPoint: /v1/partnermanager/oauth/client @@ -145,7 +165,11 @@ CreateOIDCClient: "clientAuthMethods": "private_key_jwt" }' output: '{ - "errorCode": "invalid_grant_type" + "errors": [ + { + "errorCode": "invalid_grant_type" + } + ] }' Pms_CreateOIDCClient_without_granttypes: endPoint: /v1/partnermanager/oauth/client @@ -166,7 +190,11 @@ CreateOIDCClient: "clientAuthMethods": "private_key_jwt" }' output: '{ - "errorCode": "PMS_COR_001" + "errors": [ + { + "errorCode": "PMS_COR_001" + } + ] }' Pms_CreateOIDCClient_without_name: endPoint: /v1/partnermanager/oauth/client @@ -187,7 +215,11 @@ CreateOIDCClient: "clientAuthMethods": "private_key_jwt" }' output: '{ - "errorCode": "PMS_COR_001" + "errors": [ + { + "errorCode": "PMS_COR_001" + } + ] }' Pms_CreateOIDCClient_invalid_publickey: endPoint: /v1/partnermanager/oauth/client @@ -208,5 +240,9 @@ CreateOIDCClient: "clientAuthMethods": "private_key_jwt" }' output: '{ - "errorCode": "PMS_COR_001" + "errors": [ + { + "errorCode": "PMS_COR_001" + } + ] }' \ No newline at end of file diff --git a/apitest/src/main/resources/pms/OIDCClient/UpdateOIDCClient.yml b/apitest/src/main/resources/pms/OIDCClient/UpdateOIDCClient.yml index b569482d98..5c20d7ccc4 100644 --- a/apitest/src/main/resources/pms/OIDCClient/UpdateOIDCClient.yml +++ b/apitest/src/main/resources/pms/OIDCClient/UpdateOIDCClient.yml @@ -3,7 +3,7 @@ UpdateOIDCClient: endPoint: /v1/partnermanager/oauth/client/{client_id} role: partnerrevamp checkErrorsOnlyInResponse: true - restMethod: post + restMethod: put inputTemplate: pms/OIDCClient/oIDCClientUpdate outputTemplate: pms/OIDCClient/oIDCClientResult input: '{ diff --git a/apitest/src/main/resources/pms/UpdatePolicyStatus/UpdatePolicyStatus.yml b/apitest/src/main/resources/pms/UpdatePolicyStatus/UpdatePolicyStatus.yml index 17adb58926..e451468fa2 100644 --- a/apitest/src/main/resources/pms/UpdatePolicyStatus/UpdatePolicyStatus.yml +++ b/apitest/src/main/resources/pms/UpdatePolicyStatus/UpdatePolicyStatus.yml @@ -88,8 +88,7 @@ UpdatePolicyStatus: output: ' { "errors": [ { - "errorCode": "PMS_POL_045", - "message": "Policy Status either Active or De-active." + "errorCode": "PMS_POL_045" } ] }' @@ -109,8 +108,7 @@ UpdatePolicyStatus: output: ' { "errors": [ { - "errorCode": "PMS_POL_016", - "message": "Policy Group ID does not exist" + "errorCode": "PMS_POL_016" } ] }' @@ -130,8 +128,7 @@ UpdatePolicyStatus: output: ' { "errors": [ { - "errorCode": "PMS_COR_003", - "message": "Could not process the request" + "errorCode": "PMS_COR_003" } ] }' \ No newline at end of file diff --git a/apitest/src/main/resources/pms/VerifyPartnersEmail/VerifyPartnersEmail.yml b/apitest/src/main/resources/pms/VerifyPartnersEmail/VerifyPartnersEmail.yml index 1af26b8f2a..b3d58c8c23 100644 --- a/apitest/src/main/resources/pms/VerifyPartnersEmail/VerifyPartnersEmail.yml +++ b/apitest/src/main/resources/pms/VerifyPartnersEmail/VerifyPartnersEmail.yml @@ -14,7 +14,7 @@ VerifyPartnersEmail: }' Pms_VerifyPartnersEmail_without_token: endPoint: /v1/partnermanager/partners/email/verify - role: + role: partner restMethod: put inputTemplate: pms/VerifyPartnersEmail/verifyPartnersEmail outputTemplate: pms/error diff --git a/apitest/src/main/resources/pms/partnerPolicyMapping/partnerPolicyMapping.yml b/apitest/src/main/resources/pms/partnerPolicyMapping/partnerPolicyMapping.yml index 7c06dd125e..d1d40eab89 100644 --- a/apitest/src/main/resources/pms/partnerPolicyMapping/partnerPolicyMapping.yml +++ b/apitest/src/main/resources/pms/partnerPolicyMapping/partnerPolicyMapping.yml @@ -27,7 +27,11 @@ partnerPolicyMapping: "requesttime": "$TIMESTAMP$" }' output: '{ - "errorCode": "PMS_PRT_073" + "errors": [ + { + "errorCode": "PMS_PRT_073" + } + ] }' Pms_partnerPolicyMapping_invalid_partnerId: endPoint: /v1/partnermanager/partners/1hhggg9/policy/map @@ -42,7 +46,11 @@ partnerPolicyMapping: "requesttime": "$TIMESTAMP$" }' output: '{ - "errorCode": "PMS_PRT_005" + "errors": [ + { + "errorCode": "PMS_PRT_005" + } + ] }' Pms_partnerPolicyMapping_missing_policyName: endPoint: /v1/partnermanager/partners/111999/policy/map @@ -57,7 +65,11 @@ partnerPolicyMapping: "requesttime": "$TIMESTAMP$" }' output: '{ - "errorCode": "PMS_COR_001" + "errors": [ + { + "errorCode": "PMS_COR_001" + } + ] }' Pms_partnerPolicyMapping_missing_useCaseDescription: endPoint: /v1/partnermanager/partners/111999/policy/map From a9b3eed16fe178d4deee38fe1ea67f163d8cdec9 Mon Sep 17 00:00:00 2001 From: Likhitha R L Date: Tue, 20 Aug 2024 10:38:52 +0530 Subject: [PATCH 04/10] negative testcases Signed-off-by: Likhitha R L --- .../main/resources/config/Kernel.properties | 56 +++++++++---------- .../resources/pms/OIDCClient/OIDCClient.yml | 9 +++ .../pms/PublishPolicy/PublishPolicy.yml | 5 ++ .../UploadCACertificate.yml | 9 ++- .../UploadPartnerCert/UploadPartnerCert.yml | 3 + .../partnerPolicyMapping.yml | 4 ++ 6 files changed, 55 insertions(+), 31 deletions(-) diff --git a/apitest/src/main/resources/config/Kernel.properties b/apitest/src/main/resources/config/Kernel.properties index 7e366121e6..9e0b2e7b73 100644 --- a/apitest/src/main/resources/config/Kernel.properties +++ b/apitest/src/main/resources/config/Kernel.properties @@ -136,17 +136,17 @@ AuthClientID = mosip-resident-client #---------------------------------- Client Secret Keys -----------------------# #-- When test rig ran in docker, these values dervied from the environment ---# -mosip_partner_client_secret = vXS7WUyPDpfWYuoz -mosip_pms_client_secret = qG3eE2aRzbIwLX01 -mosip_resident_client_secret = N4xRICdDT4HYvo21 -mosip_idrepo_client_secret = oQXHRL4UsgKxlVaU -mosip_reg_client_secret = bCR3Xviw9EPPlpUv -mosip_admin_client_secret = uuQoXFn2FT5OKMOr -mosip_hotlist_client_secret = Gh0VQLBVAagN1qrD -mosip_regproc_client_secret = rOE0Tx44C4HJ05qi -mpartner_default_mobile_secret = WqzUI7CYDXw6DVTV -mosip_testrig_client_secret = XfrFYmV9ENVXGDUq -AuthClientSecret = N4xRICdDT4HYvo21 +mosip_partner_client_secret = +mosip_pms_client_secret = +mosip_resident_client_secret = +mosip_idrepo_client_secret = +mosip_reg_client_secret = +mosip_admin_client_secret = +mosip_hotlist_client_secret = +mosip_regproc_client_secret = +mpartner_default_mobile_secret = +mosip_testrig_client_secret = +AuthClientSecret = @@ -158,7 +158,7 @@ s3-account = automation s3-region = null reportExpirationInDays = 3 s3-account-for-persona-data = personaData -push-reports-to-s3 = no +push-reports-to-s3 = yes #-------------------- Keycloak User Creation proprties ----------------------# @@ -168,17 +168,17 @@ new_Resident_Password = mosip123 new_Resident_Role = default-roles-mosip,PARTNER_ADMIN roles.111995 = PARTNER_ADMIN,default-roles-mosip keycloak_UserName = admin -keycloak_Password = 3Bj8VPUruV -keycloak-external-url = https://iam.dev1.mosip.net +keycloak_Password = +keycloak-external-url = https://iam.qa-platform1.mosip.net keycloak-realm-id = mosip -iam-users-to-create=111997,111998,220005,111992,globaladmin,111999,111887 -iam-users-password=mosip123,mosip123,mosip123,mosip123,mosip123,mosip123,mosip123 -roles.220005=GLOBAL_ADMIN,ID_AUTHENTICATION,REGISTRATION_ADMIN,REGISTRATION_SUPERVISOR,ZONAL_ADMIN -roles.111997=AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,POLICYMANAGER,REGISTRATION_SUPERVISOR +iam-users-to-create = 111997,111998,220005,111992,globaladmin,111887,111999 +iam-users-password = mosip123,mosip123,mosip123,mosip123,mosip123,mosip123,mosip123 +roles.220005 = GLOBAL_ADMIN,ID_AUTHENTICATION,REGISTRATION_ADMIN,REGISTRATION_SUPERVISOR,ZONAL_ADMIN +roles.111997 = AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,POLICYMANAGER,REGISTRATION_SUPERVISOR +roles.111887 = AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,REGISTRATION_SUPERVISOR +roles.111998 = POLICYMANAGER +roles.111992 = GLOBAL_ADMIN roles.111999=AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,POLICYMANAGER,REGISTRATION_SUPERVISOR -roles.111887=AUTH_PARTNER,PARTNER_ADMIN,PMS_ADMIN,REGISTRATION_SUPERVISOR -roles.111998=POLICYMANAGER -roles.111992=GLOBAL_ADMIN roles.globaladmin = GLOBAL_ADMIN,REGISTRATION_ADMIN,uma_authorization,ZONAL_ADMIN,default-roles-mosip @@ -189,27 +189,27 @@ pool_size=1 dialect=org.hibernate.dialect.PostgreSQLDialect show_sql=true current_session_context_class=thread -audit_url=jdbc:postgresql://dev1.mosip.net:5432/mosip_audit +audit_url=jdbc:postgresql://qa-platform1.mosip.net:5432/mosip_audit audit_username=postgres -audit_password=aRWP1G52uu +audit_password= audit_default_schema=audit DB_PORT= installation-domain= -partner_url=jdbc:postgresql://dev1.mosip.net:5432/mosip_ida +partner_url=jdbc:postgresql://qa-platform1.mosip.net:5432/mosip_ida partner_username=postgres -partner_password=aRWP1G52uu +partner_password= partner_default_schema=partner reportLogPath=automationLogAndReport postgresqlUser=postgresql db-port=5432 -db-server=dev1.mosip.net +db-server=qa-platform1.mosip.net hibernate.connection.driver_class=org.postgresql.Driver hibernate.connection.pool_size=1 hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect hibernate.show_sql=true hibernate.current_session_context_class=thread db-su-user=postgres -postgres-password=aRWP1G52uu +postgres-password= pms_db_schema=pms km_db_schema=keymgr master_db_schema=master @@ -226,7 +226,7 @@ mountPath=/home/mosip/mountvolume # supported values "S-scnearioNumber" for server side and "A-scnearioNumber" for automation scenariosToSkip= # Add scenarios to include in the the execution list -# Empty if we want to execute all the scenarios--- +# if we want to execute all the scenarios--- scenariosToExecute= # supported values yes or no useExternalScenarioSheet=yes diff --git a/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml b/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml index 8303a475d1..17e669d77a 100644 --- a/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml +++ b/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml @@ -24,6 +24,7 @@ CreateOIDCClient: }' Pms_CreateOIDCClient_invalid_policyID: endPoint: /v1/partnermanager/oauth/client + description: Creating OAUTH Client with invalid policyid role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: post @@ -49,6 +50,7 @@ CreateOIDCClient: }' Pms_CreateOIDCClient_invalid_logoUri: endPoint: /v1/partnermanager/oauth/client + description: Creating OAUTH Client with invalid logoUri role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: post @@ -74,6 +76,7 @@ CreateOIDCClient: }' Pms_CreateOIDCClient_invalid_RedirectUri: endPoint: /v1/partnermanager/oauth/client + description: Creating OAUTH Client with invalid redirectUri role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: post @@ -99,6 +102,7 @@ CreateOIDCClient: }' Pms_CreateOIDCClient_without_token: endPoint: /v1/partnermanager/oauth/client + description: Creating OAUTH Client without token role: checkErrorsOnlyInResponse: true restMethod: post @@ -124,6 +128,7 @@ CreateOIDCClient: }' Pms_CreateOIDCClient_without_publickey: endPoint: /v1/partnermanager/oauth/client + description: Creating OAUTH Client without publickkey role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: post @@ -149,6 +154,7 @@ CreateOIDCClient: }' Pms_CreateOIDCClient_invalid_granttypes: endPoint: /v1/partnermanager/oauth/client + description: Creating OAUTH Client with invalid granttypes role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: post @@ -174,6 +180,7 @@ CreateOIDCClient: }' Pms_CreateOIDCClient_without_granttypes: endPoint: /v1/partnermanager/oauth/client + description: Creating OAUTH Client without granttypes role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: post @@ -199,6 +206,7 @@ CreateOIDCClient: }' Pms_CreateOIDCClient_without_name: endPoint: /v1/partnermanager/oauth/client + description: Creating OAUTH Client without name field role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: post @@ -224,6 +232,7 @@ CreateOIDCClient: }' Pms_CreateOIDCClient_invalid_publickey: endPoint: /v1/partnermanager/oauth/client + description: Creating OAUTH Client with invalid publickkey role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: post diff --git a/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml b/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml index 4ea26439b3..e47efa1dcf 100644 --- a/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml +++ b/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml @@ -30,6 +30,7 @@ createPublishPolicy: Pms_PublishPolicy_WIthRandomToken_Smoke: endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish + description: Publish The Policy role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: post @@ -58,6 +59,7 @@ createPublishPolicy: Pms_PublishPolicy_InValid_AlreadyPublished: endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish + description: Publish The Policy which is already published role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: post @@ -78,6 +80,7 @@ createPublishPolicy: Pms_PublishPolicy_InValid_policygroupId: endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish + description: Publish The Policy with invalid policygroupid role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: post @@ -98,6 +101,7 @@ createPublishPolicy: Pms_PublishPolicy_InValid_policyId: endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish + description: Publish The Policy with invalid policyid role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: post @@ -117,6 +121,7 @@ createPublishPolicy: }' Pms_PublishPolicy_missing_token: endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish + description: Publish The Policy without access token role: checkErrorsOnlyInResponse: true restMethod: post diff --git a/apitest/src/main/resources/pms/UploadCACertificate/UploadCACertificate.yml b/apitest/src/main/resources/pms/UploadCACertificate/UploadCACertificate.yml index 428ad4dcb5..51dec2a095 100644 --- a/apitest/src/main/resources/pms/UploadCACertificate/UploadCACertificate.yml +++ b/apitest/src/main/resources/pms/UploadCACertificate/UploadCACertificate.yml @@ -25,8 +25,9 @@ UploadCACertificate: }' output: ' { }' - Pms_UploadSubCACertificate_UploadAgain_All_Valid_Smoke: + Pms_UploadCACertificate_UploadAgain_All_Valid_Smoke: endPoint: /v1/partnermanager/partners/certificate/ca/upload + description: Upload CA Cert which is already uploaded role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: post @@ -42,8 +43,9 @@ UploadCACertificate: } ] }' - Pms_UploadSubCACertificate_with_invalid_data: + Pms_UploadCACertificate_with_invalid_data: endPoint: /v1/partnermanager/partners/certificate/ca/upload + description: Upload CA Cert with invalid data role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: post @@ -59,8 +61,9 @@ UploadCACertificate: } ] }' - Pms_UploadSubCACertificate_with_blank_data: + Pms_UploadCACertificate_with_blank_data: endPoint: /v1/partnermanager/partners/certificate/ca/upload + description: Upload CA Cert with blank data role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: post diff --git a/apitest/src/main/resources/pms/UploadPartnerCert/UploadPartnerCert.yml b/apitest/src/main/resources/pms/UploadPartnerCert/UploadPartnerCert.yml index cc945c176a..90019d3167 100644 --- a/apitest/src/main/resources/pms/UploadPartnerCert/UploadPartnerCert.yml +++ b/apitest/src/main/resources/pms/UploadPartnerCert/UploadPartnerCert.yml @@ -14,6 +14,7 @@ uploadPartnerCert: }' Pms_UploadPartnerCert_missing_PartnerDomain: endPoint: /v1/partnermanager/partners/certificate/upload + description: Upload Partner Cert without partnerdomain role: partnerrevamp restMethod: post inputTemplate: pms/UploadPartnerCert/uploadCert2 @@ -30,6 +31,7 @@ uploadPartnerCert: }' Pms_UploadPartnerCert_invalid_certificate: endPoint: /v1/partnermanager/partners/certificate/upload + description: Upload Partner Cert by giving invalid cert data role: partnerrevamp restMethod: post inputTemplate: pms/UploadPartnerCert/uploadCert3 @@ -46,6 +48,7 @@ uploadPartnerCert: }' Pms_UploadPartnerCert_invalid_Domain: endPoint: /v1/partnermanager/partners/certificate/upload + description: Upload Partner Cert by giving invalid domain role: partnerrevamp restMethod: post inputTemplate: pms/UploadPartnerCert/uploadCert4 diff --git a/apitest/src/main/resources/pms/partnerPolicyMapping/partnerPolicyMapping.yml b/apitest/src/main/resources/pms/partnerPolicyMapping/partnerPolicyMapping.yml index 0fbbf9c727..c3a96064f8 100644 --- a/apitest/src/main/resources/pms/partnerPolicyMapping/partnerPolicyMapping.yml +++ b/apitest/src/main/resources/pms/partnerPolicyMapping/partnerPolicyMapping.yml @@ -17,6 +17,7 @@ partnerPolicyMapping: Pms_partnerPolicyMapping_invalid_policyName: endPoint: /v1/partnermanager/partners/111999/policy/map + description: Mapping Partner & Policy when invalid policyname is given role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: post @@ -36,6 +37,7 @@ partnerPolicyMapping: }' Pms_partnerPolicyMapping_invalid_partnerId: endPoint: /v1/partnermanager/partners/1hhggg9/policy/map + description: Mapping Partner & Policy when invalid partnerId is given role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: post @@ -55,6 +57,7 @@ partnerPolicyMapping: }' Pms_partnerPolicyMapping_missing_policyName: endPoint: /v1/partnermanager/partners/111999/policy/map + description: Mapping Partner & Policy when policyname is removed from request role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: post @@ -74,6 +77,7 @@ partnerPolicyMapping: }' Pms_partnerPolicyMapping_missing_useCaseDescription: endPoint: /v1/partnermanager/partners/111999/policy/map + description: Mapping Partner & Policy when usecaseDescription is removed from request role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: post From a7959c883558d8899d6a3a9b1ed9c6ae8e83f95f Mon Sep 17 00:00:00 2001 From: Likhitha R L Date: Tue, 27 Aug 2024 15:49:16 +0530 Subject: [PATCH 05/10] negative testcase Signed-off-by: Likhitha R L --- .../resources/pms/OIDCClient/OIDCClient.yml | 6 ++-- .../pms/PublishPolicy/PublishPolicy.yml | 29 ++++++++++--------- .../VerifyPartnersEmail.yml | 7 ++--- .../partnerPolicyMapping.yml | 5 +++- 4 files changed, 25 insertions(+), 22 deletions(-) diff --git a/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml b/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml index 17e669d77a..b1d1f0a847 100644 --- a/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml +++ b/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml @@ -100,10 +100,10 @@ CreateOIDCClient: } ] }' - Pms_CreateOIDCClient_without_token: + Pms_CreateOIDCClient_invalid_role: endPoint: /v1/partnermanager/oauth/client description: Creating OAUTH Client without token - role: + role: regproc checkErrorsOnlyInResponse: true restMethod: post inputTemplate: pms/OIDCClient/oIDCClient @@ -122,7 +122,7 @@ CreateOIDCClient: output: '{ "errors": [ { - "errorCode": "KER-ATH-401" + "errorCode": "KER-ATH-403" } ] }' diff --git a/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml b/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml index e47efa1dcf..e3d15ef21c 100644 --- a/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml +++ b/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml @@ -28,7 +28,7 @@ createPublishPolicy: "authTokenType": "$IGNORE$" }' - Pms_PublishPolicy_WIthRandomToken_Smoke: + Pms_PublishPolicy_WIthRandomToken_Neg: endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish description: Publish The Policy role: partnerrevamp @@ -42,18 +42,18 @@ createPublishPolicy: "requesttime": "$TIMESTAMP$" }' output: '{ - "policyGroupName": "$IGNORE$", - "policyGroupDesc": "$IGNORE$", + "policyGroupName": "mosip policy group", + "policyGroupDesc": "desc mosip policy group updated", "policyGroupStatus": true, - "policyName": "$IGNORE$", - "policyDesc": "$IGNORE$", + "policyName": " mosip policy2", + "policyDesc": "desc mosip policy2", "policyType": "Auth", "status": "PUBLISHED", "is_Active": true, - "authType": "$IGNORE$", - "authSubType": "$IGNORE$", - "mandatory": "$IGNORE$", - "attributeName": "$IGNORE$", + "authType": "bio", + "authSubType": "FINGER", + "mandatory": false, + "attributeName": "string", "authTokenType": "random" }' @@ -73,7 +73,7 @@ createPublishPolicy: output: '{ "errors": [ { - "errorCode": "PMS_POL_020" + "errorCode": "PMS_POL_020" } ] }' @@ -108,7 +108,7 @@ createPublishPolicy: inputTemplate: pms/PublishPolicy/publishPolicy outputTemplate: pms/error input: '{ - "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_sid_id$", + "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_pms_sid_id$", "policyId": "afgrwfg", "requesttime": "$TIMESTAMP$" }' @@ -119,10 +119,11 @@ createPublishPolicy: } ] }' - Pms_PublishPolicy_missing_token: + + Pms_PublishPolicy_invalid_role: endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish description: Publish The Policy without access token - role: + role: regproc checkErrorsOnlyInResponse: true restMethod: post inputTemplate: pms/PublishPolicy/publishPolicy @@ -135,7 +136,7 @@ createPublishPolicy: output: '{ "errors": [ { - "errorCode": "PMS_POL_020" + "errorCode": "KER-ATH-403" } ] }' diff --git a/apitest/src/main/resources/pms/VerifyPartnersEmail/VerifyPartnersEmail.yml b/apitest/src/main/resources/pms/VerifyPartnersEmail/VerifyPartnersEmail.yml index d19ee93e46..ae3a9cf1b6 100644 --- a/apitest/src/main/resources/pms/VerifyPartnersEmail/VerifyPartnersEmail.yml +++ b/apitest/src/main/resources/pms/VerifyPartnersEmail/VerifyPartnersEmail.yml @@ -13,9 +13,9 @@ VerifyPartnersEmail: output: '{ "emailExists": true }' - Pms_VerifyPartnersEmail_without_token: + Pms_VerifyPartnersEmail_invalid_role: endPoint: /v1/partnermanager/partners/email/verify - role: partner + role: regproc restMethod: put inputTemplate: pms/VerifyPartnersEmail/verifyPartnersEmail outputTemplate: pms/error @@ -26,7 +26,7 @@ VerifyPartnersEmail: output: '{ "errors": [ { - "errorCode": "KER-ATH-401" + "errorCode": "KER-ATH-403" } ] }' @@ -64,4 +64,3 @@ VerifyPartnersEmail: } ] }' - diff --git a/apitest/src/main/resources/pms/partnerPolicyMapping/partnerPolicyMapping.yml b/apitest/src/main/resources/pms/partnerPolicyMapping/partnerPolicyMapping.yml index c3a96064f8..7c01e617a2 100644 --- a/apitest/src/main/resources/pms/partnerPolicyMapping/partnerPolicyMapping.yml +++ b/apitest/src/main/resources/pms/partnerPolicyMapping/partnerPolicyMapping.yml @@ -85,9 +85,12 @@ partnerPolicyMapping: outputTemplate: pms/error input: '{ "policyName": "mosip policy 19234", - "useCaseDescription": "$REMOVE$", + "useCaseDescription":"$REMOVE$", "requesttime": "$TIMESTAMP$" }' output: '{ + "errors": [ + { "errorCode": "PMS_COR_001" + ] }' \ No newline at end of file From 740d0a653929b9b7ac4030233654b6ec25742a94 Mon Sep 17 00:00:00 2001 From: Likhitha R L Date: Thu, 29 Aug 2024 12:12:59 +0530 Subject: [PATCH 06/10] MOSIP-34432 Signed-off-by: Likhitha R L --- ...erApiKey.yml => ActivatePartnerApiKey.yml} | 0 .../DeactivatePartnerApiKey.yml | 19 +++++++ ...llApiKeyForAuthPartnernegativescenario.yml | 19 +++++++ ...eyForAuthPartnerResultnegativescenario.hbs | 2 + ...llApiKeyForAuthPartnernegativescenario.hbs | 2 + ...GetAllRequestedPolicyNegativeScenarios.yml | 13 +++++ apitest/testNgXmlFiles/pmsApi.xml | 56 +++++++++++++++++-- 7 files changed, 107 insertions(+), 4 deletions(-) rename apitest/src/main/resources/pms/ActivateDeactivatePartnerApiKey/{ActivateDeactivatePartnerApiKey.yml => ActivatePartnerApiKey.yml} (100%) create mode 100644 apitest/src/main/resources/pms/ActivateDeactivatePartnerApiKey/DeactivatePartnerApiKey.yml create mode 100644 apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner2/GetAllApiKeyForAuthPartnernegativescenario.yml create mode 100644 apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner2/getAllApiKeyForAuthPartnerResultnegativescenario.hbs create mode 100644 apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner2/getAllApiKeyForAuthPartnernegativescenario.hbs create mode 100644 apitest/src/main/resources/pms/GetAllRequestedPolicy/GetAllRequestedPolicyNegativeScenarios.yml diff --git a/apitest/src/main/resources/pms/ActivateDeactivatePartnerApiKey/ActivateDeactivatePartnerApiKey.yml b/apitest/src/main/resources/pms/ActivateDeactivatePartnerApiKey/ActivatePartnerApiKey.yml similarity index 100% rename from apitest/src/main/resources/pms/ActivateDeactivatePartnerApiKey/ActivateDeactivatePartnerApiKey.yml rename to apitest/src/main/resources/pms/ActivateDeactivatePartnerApiKey/ActivatePartnerApiKey.yml diff --git a/apitest/src/main/resources/pms/ActivateDeactivatePartnerApiKey/DeactivatePartnerApiKey.yml b/apitest/src/main/resources/pms/ActivateDeactivatePartnerApiKey/DeactivatePartnerApiKey.yml new file mode 100644 index 0000000000..52221c5ac7 --- /dev/null +++ b/apitest/src/main/resources/pms/ActivateDeactivatePartnerApiKey/DeactivatePartnerApiKey.yml @@ -0,0 +1,19 @@ +ActivateDeactivatePartnerApiKey: + Pms_ActivateDeactivatePartnerApiKey_activate_allValid_smoke: + endPoint: /v1/partnermanager/partners/{partnerId}/policy/{policyId}/apiKey/status + role: partnerrevamp + description: Deactivating Partner API Key + checkErrorsOnlyInResponse: true + restMethod: patch + inputTemplate: pms/ActivateDeactivatePartnerApiKey/activateDeactivatePartnerApiKey + outputTemplate: pms/ActivateDeactivatePartnerApiKey/activateDeactivatePartnerApiKeyResult + input: '{ + "partnerId": "111999", + "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", + "label": "string", + "requesttime": "$TIMESTAMP$", + "status": "De-Active" +}' + output: '{ + "response": "Partner apikey de-activated successfully." +}' \ No newline at end of file diff --git a/apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner2/GetAllApiKeyForAuthPartnernegativescenario.yml b/apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner2/GetAllApiKeyForAuthPartnernegativescenario.yml new file mode 100644 index 0000000000..f640885a5c --- /dev/null +++ b/apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner2/GetAllApiKeyForAuthPartnernegativescenario.yml @@ -0,0 +1,19 @@ +GetAllApiKeyForAuthPartner: + Pms_GetAllApiKeyForAuthPartner: + endPoint: /v1/partnermanager/partners/getAllApiKeysForAuthPartners + description: Fetching all the API Key available for Auth Partner + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: pms/GetAllApiKeyForAuthPartner/getAllApiKeyForAuthPartner + outputTemplate: pms/GetAllApiKeyForAuthPartner/getAllApiKeyForAuthPartnerResult + input: '{ +}' + output: '{ + "errors": [ + { + "errorCode": "PMS_CERTIFICATE_ERROR_002" + } + ] +}' + diff --git a/apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner2/getAllApiKeyForAuthPartnerResultnegativescenario.hbs b/apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner2/getAllApiKeyForAuthPartnerResultnegativescenario.hbs new file mode 100644 index 0000000000..7a73a41bfd --- /dev/null +++ b/apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner2/getAllApiKeyForAuthPartnerResultnegativescenario.hbs @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner2/getAllApiKeyForAuthPartnernegativescenario.hbs b/apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner2/getAllApiKeyForAuthPartnernegativescenario.hbs new file mode 100644 index 0000000000..7a73a41bfd --- /dev/null +++ b/apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner2/getAllApiKeyForAuthPartnernegativescenario.hbs @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/apitest/src/main/resources/pms/GetAllRequestedPolicy/GetAllRequestedPolicyNegativeScenarios.yml b/apitest/src/main/resources/pms/GetAllRequestedPolicy/GetAllRequestedPolicyNegativeScenarios.yml new file mode 100644 index 0000000000..95c0992757 --- /dev/null +++ b/apitest/src/main/resources/pms/GetAllRequestedPolicy/GetAllRequestedPolicyNegativeScenarios.yml @@ -0,0 +1,13 @@ +GetAllRequestedPolicies: + Pms_GetAllRequestedPolicies: + endPoint: /v1/partnermanager/partners/getAllRequestedPolicies + description: Fetching all the Requested Policies + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: pms/GetAllRequestedPolicy/getAllRequestedPolicy + outputTemplate: pms/GetAllRequestedPolicy/getAllRequestedPolicyResult + input: '{ +}' + output: ' { +}' \ No newline at end of file diff --git a/apitest/testNgXmlFiles/pmsApi.xml b/apitest/testNgXmlFiles/pmsApi.xml index d2c2a947e2..e00592be74 100644 --- a/apitest/testNgXmlFiles/pmsApi.xml +++ b/apitest/testNgXmlFiles/pmsApi.xml @@ -47,7 +47,13 @@ - + + + + + + @@ -59,6 +65,13 @@ + + + + + + - + + + + + + + + @@ -142,6 +163,16 @@ + + + + + + + + + @@ -156,9 +187,9 @@ - + + value="pms/ActivateDeactivatePartnerApiKey/ActivatePartnerApiKey.yml" /> @@ -173,6 +204,23 @@ + + + + + + + + + + + + + + + Date: Thu, 29 Aug 2024 12:24:18 +0530 Subject: [PATCH 07/10] MOSIP-34432 Signed-off-by: Likhitha R L --- .../ApproveMappingKey/ApproveMappingKey.yml | 18 +++++++++++++++++- apitest/testNgXmlFiles/pmsApi.xml | 10 +++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/apitest/src/main/resources/pms/ApproveMappingKey/ApproveMappingKey.yml b/apitest/src/main/resources/pms/ApproveMappingKey/ApproveMappingKey.yml index 95f3af9df7..8b93c876ee 100644 --- a/apitest/src/main/resources/pms/ApproveMappingKey/ApproveMappingKey.yml +++ b/apitest/src/main/resources/pms/ApproveMappingKey/ApproveMappingKey.yml @@ -14,4 +14,20 @@ ApproveMappingKey: }' output: '{ "response": "Policy mapping approved successfully" - }' \ No newline at end of file + }' + Pms_ApproveMappingKey_All_Valid_Smoke: + endPoint: /v1/partnermanager/partners/policy/{mappingkey} + description: Approve the Mapping Key + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: put + inputTemplate: pms/ApproveMappingKey/approveMappingKey + outputTemplate: pms/ApproveMappingKey/approveMappingKeyResult + input: '{ + "status": "Approved", + "mappingkey": "$ID:partnerPolicyMapping_All_Valid_Smoke_sid_mappingkey$", + "requesttime": "$TIMESTAMP$" + }' + output: '{ + "response": "Policy mapping approved successfully" + }' \ No newline at end of file diff --git a/apitest/testNgXmlFiles/pmsApi.xml b/apitest/testNgXmlFiles/pmsApi.xml index e00592be74..85109e0edb 100644 --- a/apitest/testNgXmlFiles/pmsApi.xml +++ b/apitest/testNgXmlFiles/pmsApi.xml @@ -128,7 +128,15 @@ - + + + + + + + + From 2c17e35896943b2493515a7b10db7874329e2f2b Mon Sep 17 00:00:00 2001 From: Likhitha R L Date: Fri, 30 Aug 2024 17:34:18 +0530 Subject: [PATCH 08/10] MOSIP-34432 negative testcase Signed-off-by: Likhitha R L --- .../ApproveMappingKey/ApproveMappingKey.yml | 73 ++++++++++++++++++- .../GetAllActivePolicyGroups.yml | 36 ++++++++- .../GetAllApiKeyForAuthPartner.yml | 38 +++++++++- .../GetAllApprovedAuthPartnerPolicy.yml | 36 ++++++++- .../GetAllApprovedPartnerId.yml | 5 ++ .../GetAllCertificate/GetAllCertificate.yml | 34 ++++++++- ...GetAllRequestedPolicyNegativeScenarios.yml | 30 +++++++- .../pms/PublishPolicy/PublishPolicy.yml | 30 +------- apitest/testNgXmlFiles/pmsApi.xml | 57 +++++++++++++-- 9 files changed, 292 insertions(+), 47 deletions(-) diff --git a/apitest/src/main/resources/pms/ApproveMappingKey/ApproveMappingKey.yml b/apitest/src/main/resources/pms/ApproveMappingKey/ApproveMappingKey.yml index 8b93c876ee..451abfc324 100644 --- a/apitest/src/main/resources/pms/ApproveMappingKey/ApproveMappingKey.yml +++ b/apitest/src/main/resources/pms/ApproveMappingKey/ApproveMappingKey.yml @@ -15,19 +15,84 @@ ApproveMappingKey: output: '{ "response": "Policy mapping approved successfully" }' - Pms_ApproveMappingKey_All_Valid_Smoke: + + Pms_ApproveMappingKey_Invalid_Request_Time_Neg: endPoint: /v1/partnermanager/partners/policy/{mappingkey} description: Approve the Mapping Key role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: put inputTemplate: pms/ApproveMappingKey/approveMappingKey - outputTemplate: pms/ApproveMappingKey/approveMappingKeyResult + outputTemplate: pms/error + input: '{ + "status": "Approved", + "mappingkey": "$ID:partnerPolicyMapping_All_Valid_Smoke_sid_mappingkey$", + "requesttime": "1111-07-22T08:21:17.665Z" + }' + output: '{ + "errors": [ + { + "errorCode": "PMS_COR_001", + } + ] +}' + + Pms_ApproveMappingKey_Missing_Request_Time_Neg: + endPoint: /v1/partnermanager/partners/policy/{mappingkey} + description: Approve the Mapping Key + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: put + inputTemplate: pms/ApproveMappingKey/approveMappingKey + outputTemplate: pms/error + input: '{ + "status": "Approved", + "mappingkey": "$ID:partnerPolicyMapping_All_Valid_Smoke_sid_mappingkey$" + }' + output: '{ + "errors": [ + { + "errorCode": "PMS_COR_001", + } + ] +}' + + Pms_ApproveMappingKey_Missing_mapping_key_Neg: + endPoint: /v1/partnermanager/partners/policy/{mappingkey} + description: Approve the Mapping Key + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: put + inputTemplate: pms/ApproveMappingKey/approveMappingKey + outputTemplate: pms/error input: '{ "status": "Approved", + "requesttime": "$TIMESTAMP$" + }' + output: '{ + "errors": [ + { + "errorCode": "PMS_COR_001", + } + ] +}' + + Pms_ApproveMappingKey_Missing_status_Neg: + endPoint: /v1/partnermanager/partners/policy/{mappingkey} + description: Approve the Mapping Key + role: partnerrevamp + checkErrorsOnlyInResponse: true + restMethod: put + inputTemplate: pms/ApproveMappingKey/approveMappingKey + outputTemplate: pms/error + input: '{ "mappingkey": "$ID:partnerPolicyMapping_All_Valid_Smoke_sid_mappingkey$", "requesttime": "$TIMESTAMP$" }' output: '{ - "response": "Policy mapping approved successfully" - }' \ No newline at end of file + "errors": [ + { + "errorCode": "PMS_COR_001", + } + ] +}' \ No newline at end of file diff --git a/apitest/src/main/resources/pms/GetAllActivePolicyGroups/GetAllActivePolicyGroups.yml b/apitest/src/main/resources/pms/GetAllActivePolicyGroups/GetAllActivePolicyGroups.yml index 681a04247c..fcf0e79c93 100644 --- a/apitest/src/main/resources/pms/GetAllActivePolicyGroups/GetAllActivePolicyGroups.yml +++ b/apitest/src/main/resources/pms/GetAllActivePolicyGroups/GetAllActivePolicyGroups.yml @@ -1,7 +1,7 @@ GetAllActivePolicyGroups: Pms_GetAllActivePolicyGroups_All_Valid_Smoke: endPoint: /v1/policymanager/policies/getAllPolicyGroups - description: Fetching all the activated PolicyGroups + description: Fetching all the active PolicyGroups role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: get @@ -10,4 +10,38 @@ GetAllActivePolicyGroups: input: '{ }' output: ' { +}' + Pms_GetAllActivePolicyGroups_without_auth: + endPoint: /v1/policymanager/policies/getAllPolicyGroups + description: Fetching all the active PolicyGroups without token + role: invalidBatch + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: pms/GetAllActivePolicyGroups/getAllActivePolicyGroups + outputTemplate: pms/error + input: '{ +}' + output: '{ + "errors": [ + { + "errorCode": "KER-ATH-401" + } + ] +}' + Pms_GetAllActivePolicyGroups_Invalid_auth: + endPoint: /v1/policymanager/policies/getAllPolicyGroups + description: Fetching all the active PolicyGroups with invalid token + role: regproc + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: pms/GetAllActivePolicyGroups/getAllActivePolicyGroups + outputTemplate: pms/error + input: '{ +}' + output: '{ + "errors": [ + { + "errorCode": "KER-ATH-403" + } + ] }' diff --git a/apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner/GetAllApiKeyForAuthPartner.yml b/apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner/GetAllApiKeyForAuthPartner.yml index f4e66ea152..b92ba5d6fc 100644 --- a/apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner/GetAllApiKeyForAuthPartner.yml +++ b/apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner/GetAllApiKeyForAuthPartner.yml @@ -1,7 +1,7 @@ GetAllApiKeyForAuthPartner: Pms_GetAllApiKeyForAuthPartner_All_Valid_Smoke: endPoint: /v1/partnermanager/partners/getAllApiKeysForAuthPartners - description: Fetching all the API Key available for Auth Partners + description: Fetching all the API Key available for Auth Partner role: partnerrevamp checkErrorsOnlyInResponse: true restMethod: get @@ -9,5 +9,39 @@ GetAllApiKeyForAuthPartner: outputTemplate: pms/GetAllApiKeyForAuthPartner/getAllApiKeyForAuthPartnerResult input: '{ }' - output: ' { + output: '{ +}' + Pms_GetAllApiKeyForAuthPartner_without_auth: + endPoint: /v1/partnermanager/partners/getAllApiKeysForAuthPartners + description: Fetching all the API Key available for Auth Partner without token + role: invalidBatch + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: pms/GetAllApiKeyForAuthPartner/getAllApiKeyForAuthPartner + outputTemplate: pms/error + input: '{ +}' + output: '{ + "errors": [ + { + "errorCode": "KER-ATH-401" + } + ] +}' + Pms_GetAllApiKeyForAuthPartner_invalid_auth: + endPoint: /v1/partnermanager/partners/getAllApiKeysForAuthPartners + description: Fetching all the API Key available for Auth Partner with invalid token + role: regproc + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: pms/GetAllApiKeyForAuthPartner/getAllApiKeyForAuthPartner + outputTemplate: pms/error + input: '{ +}' + output: '{ + "errors": [ + { + "errorCode": "KER-ATH-403" + } + ] }' \ No newline at end of file diff --git a/apitest/src/main/resources/pms/GetAllApprovedAuthPartnerPolicy/GetAllApprovedAuthPartnerPolicy.yml b/apitest/src/main/resources/pms/GetAllApprovedAuthPartnerPolicy/GetAllApprovedAuthPartnerPolicy.yml index 56b322c9b2..779b4f6e99 100644 --- a/apitest/src/main/resources/pms/GetAllApprovedAuthPartnerPolicy/GetAllApprovedAuthPartnerPolicy.yml +++ b/apitest/src/main/resources/pms/GetAllApprovedAuthPartnerPolicy/GetAllApprovedAuthPartnerPolicy.yml @@ -9,5 +9,39 @@ GetAllApprovedAuthPartnerPolicy: outputTemplate: pms/GetAllApprovedAuthPartnerPolicy/getAllApprovedAuthPartnerPolicyResult input: '{ }' - output: ' { + output: '{ +}' + Pms_GetAllApprovedAuthPartnerPolicy_without_auth: + endPoint: /v1/partnermanager/partners/getAllApprovedAuthPartnerPolicies + description: Fetching all Approved Auth Partner Policies without token + role: invalidBatch + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: pms/GetAllApprovedAuthPartnerPolicy/getAllApprovedAuthPartnerPolicy + outputTemplate: pms/error + input: '{ +}' + output: '{ + "errors": [ + { + "errorCode": "KER-ATH-401" + } + ] +}' + Pms_GetAllApprovedAuthPartnerPolicy_invalid_auth: + endPoint: /v1/partnermanager/partners/getAllApprovedAuthPartnerPolicies + description: Fetching all Approved Auth Partner Policies with invalid token + role: regproc + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: pms/GetAllApprovedAuthPartnerPolicy/getAllApprovedAuthPartnerPolicy + outputTemplate: pms/error + input: '{ +}' + output: '{ + "errors": [ + { + "errorCode": "KER-ATH-403" + } + ] }' \ No newline at end of file diff --git a/apitest/src/main/resources/pms/GetAllApprovedPartnerId/GetAllApprovedPartnerId.yml b/apitest/src/main/resources/pms/GetAllApprovedPartnerId/GetAllApprovedPartnerId.yml index 053749050a..72fcdd69c6 100644 --- a/apitest/src/main/resources/pms/GetAllApprovedPartnerId/GetAllApprovedPartnerId.yml +++ b/apitest/src/main/resources/pms/GetAllApprovedPartnerId/GetAllApprovedPartnerId.yml @@ -9,4 +9,9 @@ GetAllApprovedPartnerId: input: '{ }' output: '{ + "errors": [ + { + "errorCode": "PMS_CERTIFICATE_ERROR_002" + } + ] }' \ No newline at end of file diff --git a/apitest/src/main/resources/pms/GetAllCertificate/GetAllCertificate.yml b/apitest/src/main/resources/pms/GetAllCertificate/GetAllCertificate.yml index 86d53da501..872d4e7004 100644 --- a/apitest/src/main/resources/pms/GetAllCertificate/GetAllCertificate.yml +++ b/apitest/src/main/resources/pms/GetAllCertificate/GetAllCertificate.yml @@ -1,7 +1,7 @@ GetAllCertificate: Pms_GetAllCertificate_allValid_smoke: endPoint: /v1/partnermanager/partners/getAllCertificateDetails - description: Fetching all the API certificates of the Loggedin Partner + description: Fetching all the API certificates of the Logged in Partner role: partnerrevamp restMethod: get inputTemplate: pms/GetAllCertificate/getAllCertificate @@ -9,4 +9,36 @@ GetAllCertificate: input: '{ }' output: '{ +}' + Pms_GetAllCertificate_without_auth: + endPoint: /v1/partnermanager/partners/getAllCertificateDetails + description: Fetching all the API certificates of the partner without login + role: invalidBatch + restMethod: get + inputTemplate: pms/GetAllCertificate/getAllCertificate + outputTemplate: pms/error + input: '{ +}' + output: '{ + "errors": [ + { + "errorCode": "KER-ATH-401" + } + ] +}' + Pms_GetAllCertificate_invalid_auth: + endPoint: /v1/partnermanager/partners/getAllCertificateDetails + description: Fetching all the API certificates of the partner invalid partner + role: regproc + restMethod: get + inputTemplate: pms/GetAllCertificate/getAllCertificate + outputTemplate: pms/error + input: '{ +}' + output: '{ + "errors": [ + { + "errorCode": "KER-ATH-403" + } + ] }' \ No newline at end of file diff --git a/apitest/src/main/resources/pms/GetAllRequestedPolicy/GetAllRequestedPolicyNegativeScenarios.yml b/apitest/src/main/resources/pms/GetAllRequestedPolicy/GetAllRequestedPolicyNegativeScenarios.yml index 95c0992757..942b75af71 100644 --- a/apitest/src/main/resources/pms/GetAllRequestedPolicy/GetAllRequestedPolicyNegativeScenarios.yml +++ b/apitest/src/main/resources/pms/GetAllRequestedPolicy/GetAllRequestedPolicyNegativeScenarios.yml @@ -1,13 +1,35 @@ GetAllRequestedPolicies: - Pms_GetAllRequestedPolicies: + Pms_GetAllRequestedPolicies_without_auth: endPoint: /v1/partnermanager/partners/getAllRequestedPolicies - description: Fetching all the Requested Policies - role: partnerrevamp + description: Fetching all the Requested Policies without login token + role: invalidbatch checkErrorsOnlyInResponse: true restMethod: get inputTemplate: pms/GetAllRequestedPolicy/getAllRequestedPolicy outputTemplate: pms/GetAllRequestedPolicy/getAllRequestedPolicyResult input: '{ }' - output: ' { + output: '{ + "errors": [ + { + "errorCode": "KER-ATH-401" + } + ] +}' + Pms_GetAllRequestedPolicies_invalid_auth: + endPoint: /v1/partnermanager/partners/getAllRequestedPolicies + description: Fetching all the Requested Policies with invalid role + role: regproc + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: pms/GetAllRequestedPolicy/getAllRequestedPolicy + outputTemplate: pms/GetAllRequestedPolicy/getAllRequestedPolicyResult + input: '{ +}' + output: '{ + "errors": [ + { + "errorCode": "KER-ATH-403" + } + ] }' \ No newline at end of file diff --git a/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml b/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml index e3d15ef21c..47cc3b7fc5 100644 --- a/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml +++ b/apitest/src/main/resources/pms/PublishPolicy/PublishPolicy.yml @@ -28,34 +28,6 @@ createPublishPolicy: "authTokenType": "$IGNORE$" }' - Pms_PublishPolicy_WIthRandomToken_Neg: - endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish - description: Publish The Policy - role: partnerrevamp - checkErrorsOnlyInResponse: true - restMethod: post - inputTemplate: pms/PublishPolicy/publishPolicy - outputTemplate: pms/PublishPolicy/publishPolicyResult - input: '{ - "policygroupId": "$ID:DefinePolicyGroup_All_Valid_Smoke_pms_sid_id$", - "policyId": "$ID:DefinePolicy_All_Valid_Smoke_pms_sid_id$", - "requesttime": "$TIMESTAMP$" -}' - output: '{ - "policyGroupName": "mosip policy group", - "policyGroupDesc": "desc mosip policy group updated", - "policyGroupStatus": true, - "policyName": " mosip policy2", - "policyDesc": "desc mosip policy2", - "policyType": "Auth", - "status": "PUBLISHED", - "is_Active": true, - "authType": "bio", - "authSubType": "FINGER", - "mandatory": false, - "attributeName": "string", - "authTokenType": "random" - }' Pms_PublishPolicy_InValid_AlreadyPublished: endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish @@ -120,7 +92,7 @@ createPublishPolicy: ] }' - Pms_PublishPolicy_invalid_role: + Pms_PublishPolicy_invalid_auth: endPoint: /v1/policymanager/policies/{policyId}/group/{policygroupId}/publish description: Publish The Policy without access token role: regproc diff --git a/apitest/testNgXmlFiles/pmsApi.xml b/apitest/testNgXmlFiles/pmsApi.xml index 85109e0edb..fc61dd0872 100644 --- a/apitest/testNgXmlFiles/pmsApi.xml +++ b/apitest/testNgXmlFiles/pmsApi.xml @@ -53,9 +53,23 @@ - - + + + + + + + + + + + + + + - + + @@ -81,13 +96,29 @@ + + + + + + + - + + + + + + + + + + + + + + + @@ -131,7 +170,7 @@ + value= "pms/GetAllRequestedPolicy/GetAllRequestedPolicy.yml" /> @@ -163,6 +202,14 @@ + + + + + + + From 0d78987ebd44ff09ff101aa4b71e4d9d8c65c379 Mon Sep 17 00:00:00 2001 From: Likhitha R L Date: Mon, 2 Sep 2024 13:25:52 +0530 Subject: [PATCH 09/10] MOSIP-34432 negative testcases Signed-off-by: Likhitha R L --- .../GetAllApprovedAuthPartnerPolicy.yml | 36 +----------------- ...ovedAuthPartnerPolicyNegativeScenarios.yml | 35 ++++++++++++++++++ ...tAllApprovedPartnerIdNegativeScenarios.yml | 33 +++++++++++++++++ .../GetAllCertificateNegativeScenarios.yml | 17 +++++++++ .../GetAllOidcClientNegativeScenarios.yml | 35 ++++++++++++++++++ apitest/testNgXmlFiles/pmsApi.xml | 37 ++++++++++++++++++- 6 files changed, 156 insertions(+), 37 deletions(-) create mode 100644 apitest/src/main/resources/pms/GetAllApprovedAuthPartnerPolicy/GetAllApprovedAuthPartnerPolicyNegativeScenarios.yml create mode 100644 apitest/src/main/resources/pms/GetAllApprovedPartnerId/GetAllApprovedPartnerIdNegativeScenarios.yml create mode 100644 apitest/src/main/resources/pms/GetAllCertificate/GetAllCertificateNegativeScenarios.yml create mode 100644 apitest/src/main/resources/pms/GetAllOidcClient/GetAllOidcClientNegativeScenarios.yml diff --git a/apitest/src/main/resources/pms/GetAllApprovedAuthPartnerPolicy/GetAllApprovedAuthPartnerPolicy.yml b/apitest/src/main/resources/pms/GetAllApprovedAuthPartnerPolicy/GetAllApprovedAuthPartnerPolicy.yml index 779b4f6e99..d6744c58a4 100644 --- a/apitest/src/main/resources/pms/GetAllApprovedAuthPartnerPolicy/GetAllApprovedAuthPartnerPolicy.yml +++ b/apitest/src/main/resources/pms/GetAllApprovedAuthPartnerPolicy/GetAllApprovedAuthPartnerPolicy.yml @@ -10,38 +10,4 @@ GetAllApprovedAuthPartnerPolicy: input: '{ }' output: '{ -}' - Pms_GetAllApprovedAuthPartnerPolicy_without_auth: - endPoint: /v1/partnermanager/partners/getAllApprovedAuthPartnerPolicies - description: Fetching all Approved Auth Partner Policies without token - role: invalidBatch - checkErrorsOnlyInResponse: true - restMethod: get - inputTemplate: pms/GetAllApprovedAuthPartnerPolicy/getAllApprovedAuthPartnerPolicy - outputTemplate: pms/error - input: '{ -}' - output: '{ - "errors": [ - { - "errorCode": "KER-ATH-401" - } - ] -}' - Pms_GetAllApprovedAuthPartnerPolicy_invalid_auth: - endPoint: /v1/partnermanager/partners/getAllApprovedAuthPartnerPolicies - description: Fetching all Approved Auth Partner Policies with invalid token - role: regproc - checkErrorsOnlyInResponse: true - restMethod: get - inputTemplate: pms/GetAllApprovedAuthPartnerPolicy/getAllApprovedAuthPartnerPolicy - outputTemplate: pms/error - input: '{ -}' - output: '{ - "errors": [ - { - "errorCode": "KER-ATH-403" - } - ] -}' \ No newline at end of file +}' \ No newline at end of file diff --git a/apitest/src/main/resources/pms/GetAllApprovedAuthPartnerPolicy/GetAllApprovedAuthPartnerPolicyNegativeScenarios.yml b/apitest/src/main/resources/pms/GetAllApprovedAuthPartnerPolicy/GetAllApprovedAuthPartnerPolicyNegativeScenarios.yml new file mode 100644 index 0000000000..30df44d368 --- /dev/null +++ b/apitest/src/main/resources/pms/GetAllApprovedAuthPartnerPolicy/GetAllApprovedAuthPartnerPolicyNegativeScenarios.yml @@ -0,0 +1,35 @@ +GetAllApprovedAuthPartnerPolicy: + Pms_GetAllApprovedAuthPartnerPolicy_without_auth: + endPoint: /v1/partnermanager/partners/getAllApprovedAuthPartnerPolicies + description: Fetching all Approved Auth Partner Policies without token + role: invalidBatch + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: pms/GetAllApprovedAuthPartnerPolicy/getAllApprovedAuthPartnerPolicy + outputTemplate: pms/error + input: '{ +}' + output: '{ + "errors": [ + { + "errorCode": "KER-ATH-401" + } + ] +}' + Pms_GetAllApprovedAuthPartnerPolicy_invalid_auth: + endPoint: /v1/partnermanager/partners/getAllApprovedAuthPartnerPolicies + description: Fetching all Approved Auth Partner Policies with invalid token + role: regproc + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: pms/GetAllApprovedAuthPartnerPolicy/getAllApprovedAuthPartnerPolicy + outputTemplate: pms/error + input: '{ +}' + output: '{ + "errors": [ + { + "errorCode": "KER-ATH-403" + } + ] +}' \ No newline at end of file diff --git a/apitest/src/main/resources/pms/GetAllApprovedPartnerId/GetAllApprovedPartnerIdNegativeScenarios.yml b/apitest/src/main/resources/pms/GetAllApprovedPartnerId/GetAllApprovedPartnerIdNegativeScenarios.yml new file mode 100644 index 0000000000..015cc02ec6 --- /dev/null +++ b/apitest/src/main/resources/pms/GetAllApprovedPartnerId/GetAllApprovedPartnerIdNegativeScenarios.yml @@ -0,0 +1,33 @@ +GetAllApprovedPartnerId: + Pms_GetAllApprovedPartnerId_without_auth: + endPoint: /v1/partnermanager/partners/getAllApprovedPartnerIdsWithPolicyGroups + description: Fetching all approved Partner Id without token + role: invalidBatch + restMethod: get + inputTemplate: pms/GetAllApprovedPartnerId/getAllApprovedPartnerId + outputTemplate: pms/error + input: '{ +}' + output: '{ + "errors": [ + { + "errorCode": "KER-ATH-401" + } + ] +}' + Pms_GetAllApprovedPartnerId_invalid_auth: + endPoint: /v1/partnermanager/partners/getAllApprovedPartnerIdsWithPolicyGroups + description: Fetching all approved Partner Id with invalid token + role: regproc + restMethod: get + inputTemplate: pms/GetAllApprovedPartnerId/getAllApprovedPartnerId + outputTemplate: pms/error + input: '{ +}' + output: '{ + "errors": [ + { + "errorCode": "KER-ATH-403" + } + ] +}' \ No newline at end of file diff --git a/apitest/src/main/resources/pms/GetAllCertificate/GetAllCertificateNegativeScenarios.yml b/apitest/src/main/resources/pms/GetAllCertificate/GetAllCertificateNegativeScenarios.yml new file mode 100644 index 0000000000..75c9900078 --- /dev/null +++ b/apitest/src/main/resources/pms/GetAllCertificate/GetAllCertificateNegativeScenarios.yml @@ -0,0 +1,17 @@ +GetAllCertificate: + Pms_GetAllCertificate_beforecertifiactes_upload: + endPoint: /v1/partnermanager/partners/getAllCertificateDetails + description: Fetching all the API certificates of the Logged in Partner + role: partnerrevamp + restMethod: get + inputTemplate: pms/GetAllCertificate/getAllCertificate + outputTemplate: pms/GetAllCertificate/getAllCertificateResult + input: '{ +}' + output: '{ + "errors": [ + { + "errorCode": "PMS_CERTIFICATE_ERROR_002" + } + ] +}' diff --git a/apitest/src/main/resources/pms/GetAllOidcClient/GetAllOidcClientNegativeScenarios.yml b/apitest/src/main/resources/pms/GetAllOidcClient/GetAllOidcClientNegativeScenarios.yml new file mode 100644 index 0000000000..4b40b36250 --- /dev/null +++ b/apitest/src/main/resources/pms/GetAllOidcClient/GetAllOidcClientNegativeScenarios.yml @@ -0,0 +1,35 @@ +GetAllOidcClient: + Pms_GetAllOidcClient_without_Auth: + endPoint: /v1/partnermanager/getAllOidcClients + description: Fetching all OIDC Clients of the loggedin Partner + role: invalidBatch + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: pms/GetAllOidcClient/getAllOidcClient + outputTemplate: pms/GetAllOidcClient/getAllOidcClientResult + input: '{ +}' + output: '{ + "errors": [ + { + "errorCode": "KER-ATH-401" + } + ] +}' + Pms_GetAllOidcClient_Invalid_Auth: + endPoint: /v1/partnermanager/getAllOidcClients + description: Fetching all OIDC Clients of the loggedin Partner + role: regproc + checkErrorsOnlyInResponse: true + restMethod: get + inputTemplate: pms/GetAllOidcClient/getAllOidcClient + outputTemplate: pms/GetAllOidcClient/getAllOidcClientResult + input: '{ +}' + output: '{ + "errors": [ + { + "errorCode": "KER-ATH-403" + } + ] +}' \ No newline at end of file diff --git a/apitest/testNgXmlFiles/pmsApi.xml b/apitest/testNgXmlFiles/pmsApi.xml index fc61dd0872..c3a54834da 100644 --- a/apitest/testNgXmlFiles/pmsApi.xml +++ b/apitest/testNgXmlFiles/pmsApi.xml @@ -175,6 +175,13 @@ + + + + + + - + + + + + + - + + + + + + @@ -300,6 +319,13 @@ + + + + + + @@ -308,6 +334,13 @@ + + + + + + From fa1e0385957b591579d7f0fdf65d76a6d250022a Mon Sep 17 00:00:00 2001 From: Likhitha R L Date: Mon, 2 Sep 2024 14:10:55 +0530 Subject: [PATCH 10/10] MOSIP-34432 negative testcases Signed-off-by: Likhitha R L --- .../GetAllActivePolicyGroups/GetAllActivePolicyGroups.yml | 2 +- .../GetAllApiKeyForAuthPartner.yml | 2 +- .../GetAllApprovedAuthPartnerPolicyNegativeScenarios.yml | 2 +- .../GetAllApprovedPartnerIdNegativeScenarios.yml | 2 +- .../resources/pms/GetAllCertificate/GetAllCertificate.yml | 2 +- .../resources/pms/GetAllOidcClient/GetAllOidcClient.yml | 7 ++++++- .../GetAllOidcClient/GetAllOidcClientNegativeScenarios.yml | 2 +- .../GetAllRequestedPolicyNegativeScenarios.yml | 2 +- apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml | 2 +- .../pms/VerifyPartnersEmail/VerifyPartnersEmail.yml | 6 +++--- 10 files changed, 17 insertions(+), 12 deletions(-) diff --git a/apitest/src/main/resources/pms/GetAllActivePolicyGroups/GetAllActivePolicyGroups.yml b/apitest/src/main/resources/pms/GetAllActivePolicyGroups/GetAllActivePolicyGroups.yml index fcf0e79c93..237e39b415 100644 --- a/apitest/src/main/resources/pms/GetAllActivePolicyGroups/GetAllActivePolicyGroups.yml +++ b/apitest/src/main/resources/pms/GetAllActivePolicyGroups/GetAllActivePolicyGroups.yml @@ -14,7 +14,7 @@ GetAllActivePolicyGroups: Pms_GetAllActivePolicyGroups_without_auth: endPoint: /v1/policymanager/policies/getAllPolicyGroups description: Fetching all the active PolicyGroups without token - role: invalidBatch + role: batch checkErrorsOnlyInResponse: true restMethod: get inputTemplate: pms/GetAllActivePolicyGroups/getAllActivePolicyGroups diff --git a/apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner/GetAllApiKeyForAuthPartner.yml b/apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner/GetAllApiKeyForAuthPartner.yml index b92ba5d6fc..81d3717e21 100644 --- a/apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner/GetAllApiKeyForAuthPartner.yml +++ b/apitest/src/main/resources/pms/GetAllApiKeyForAuthPartner/GetAllApiKeyForAuthPartner.yml @@ -14,7 +14,7 @@ GetAllApiKeyForAuthPartner: Pms_GetAllApiKeyForAuthPartner_without_auth: endPoint: /v1/partnermanager/partners/getAllApiKeysForAuthPartners description: Fetching all the API Key available for Auth Partner without token - role: invalidBatch + role: batch checkErrorsOnlyInResponse: true restMethod: get inputTemplate: pms/GetAllApiKeyForAuthPartner/getAllApiKeyForAuthPartner diff --git a/apitest/src/main/resources/pms/GetAllApprovedAuthPartnerPolicy/GetAllApprovedAuthPartnerPolicyNegativeScenarios.yml b/apitest/src/main/resources/pms/GetAllApprovedAuthPartnerPolicy/GetAllApprovedAuthPartnerPolicyNegativeScenarios.yml index 30df44d368..7fb8d40411 100644 --- a/apitest/src/main/resources/pms/GetAllApprovedAuthPartnerPolicy/GetAllApprovedAuthPartnerPolicyNegativeScenarios.yml +++ b/apitest/src/main/resources/pms/GetAllApprovedAuthPartnerPolicy/GetAllApprovedAuthPartnerPolicyNegativeScenarios.yml @@ -2,7 +2,7 @@ GetAllApprovedAuthPartnerPolicy: Pms_GetAllApprovedAuthPartnerPolicy_without_auth: endPoint: /v1/partnermanager/partners/getAllApprovedAuthPartnerPolicies description: Fetching all Approved Auth Partner Policies without token - role: invalidBatch + role: batch checkErrorsOnlyInResponse: true restMethod: get inputTemplate: pms/GetAllApprovedAuthPartnerPolicy/getAllApprovedAuthPartnerPolicy diff --git a/apitest/src/main/resources/pms/GetAllApprovedPartnerId/GetAllApprovedPartnerIdNegativeScenarios.yml b/apitest/src/main/resources/pms/GetAllApprovedPartnerId/GetAllApprovedPartnerIdNegativeScenarios.yml index 015cc02ec6..7d9a241d36 100644 --- a/apitest/src/main/resources/pms/GetAllApprovedPartnerId/GetAllApprovedPartnerIdNegativeScenarios.yml +++ b/apitest/src/main/resources/pms/GetAllApprovedPartnerId/GetAllApprovedPartnerIdNegativeScenarios.yml @@ -2,7 +2,7 @@ GetAllApprovedPartnerId: Pms_GetAllApprovedPartnerId_without_auth: endPoint: /v1/partnermanager/partners/getAllApprovedPartnerIdsWithPolicyGroups description: Fetching all approved Partner Id without token - role: invalidBatch + role: batch restMethod: get inputTemplate: pms/GetAllApprovedPartnerId/getAllApprovedPartnerId outputTemplate: pms/error diff --git a/apitest/src/main/resources/pms/GetAllCertificate/GetAllCertificate.yml b/apitest/src/main/resources/pms/GetAllCertificate/GetAllCertificate.yml index 872d4e7004..b9ec876097 100644 --- a/apitest/src/main/resources/pms/GetAllCertificate/GetAllCertificate.yml +++ b/apitest/src/main/resources/pms/GetAllCertificate/GetAllCertificate.yml @@ -13,7 +13,7 @@ GetAllCertificate: Pms_GetAllCertificate_without_auth: endPoint: /v1/partnermanager/partners/getAllCertificateDetails description: Fetching all the API certificates of the partner without login - role: invalidBatch + role: batch restMethod: get inputTemplate: pms/GetAllCertificate/getAllCertificate outputTemplate: pms/error diff --git a/apitest/src/main/resources/pms/GetAllOidcClient/GetAllOidcClient.yml b/apitest/src/main/resources/pms/GetAllOidcClient/GetAllOidcClient.yml index ba34aef681..efa27fca6a 100644 --- a/apitest/src/main/resources/pms/GetAllOidcClient/GetAllOidcClient.yml +++ b/apitest/src/main/resources/pms/GetAllOidcClient/GetAllOidcClient.yml @@ -9,5 +9,10 @@ GetAllOidcClient: outputTemplate: pms/GetAllOidcClient/getAllOidcClientResult input: '{ }' - output: ' { + output: '{ + "errors": [ + { + "errorCode": "PMS_CERTIFICATE_ERROR_002" + } + ] }' \ No newline at end of file diff --git a/apitest/src/main/resources/pms/GetAllOidcClient/GetAllOidcClientNegativeScenarios.yml b/apitest/src/main/resources/pms/GetAllOidcClient/GetAllOidcClientNegativeScenarios.yml index 4b40b36250..71902d8c4d 100644 --- a/apitest/src/main/resources/pms/GetAllOidcClient/GetAllOidcClientNegativeScenarios.yml +++ b/apitest/src/main/resources/pms/GetAllOidcClient/GetAllOidcClientNegativeScenarios.yml @@ -2,7 +2,7 @@ GetAllOidcClient: Pms_GetAllOidcClient_without_Auth: endPoint: /v1/partnermanager/getAllOidcClients description: Fetching all OIDC Clients of the loggedin Partner - role: invalidBatch + role: batch checkErrorsOnlyInResponse: true restMethod: get inputTemplate: pms/GetAllOidcClient/getAllOidcClient diff --git a/apitest/src/main/resources/pms/GetAllRequestedPolicy/GetAllRequestedPolicyNegativeScenarios.yml b/apitest/src/main/resources/pms/GetAllRequestedPolicy/GetAllRequestedPolicyNegativeScenarios.yml index 942b75af71..e0e89cc6bf 100644 --- a/apitest/src/main/resources/pms/GetAllRequestedPolicy/GetAllRequestedPolicyNegativeScenarios.yml +++ b/apitest/src/main/resources/pms/GetAllRequestedPolicy/GetAllRequestedPolicyNegativeScenarios.yml @@ -2,7 +2,7 @@ GetAllRequestedPolicies: Pms_GetAllRequestedPolicies_without_auth: endPoint: /v1/partnermanager/partners/getAllRequestedPolicies description: Fetching all the Requested Policies without login token - role: invalidbatch + role: batch checkErrorsOnlyInResponse: true restMethod: get inputTemplate: pms/GetAllRequestedPolicy/getAllRequestedPolicy diff --git a/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml b/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml index b1d1f0a847..f0354408b9 100644 --- a/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml +++ b/apitest/src/main/resources/pms/OIDCClient/OIDCClient.yml @@ -100,7 +100,7 @@ CreateOIDCClient: } ] }' - Pms_CreateOIDCClient_invalid_role: + Pms_CreateOIDCClient_invalid_auth: endPoint: /v1/partnermanager/oauth/client description: Creating OAUTH Client without token role: regproc diff --git a/apitest/src/main/resources/pms/VerifyPartnersEmail/VerifyPartnersEmail.yml b/apitest/src/main/resources/pms/VerifyPartnersEmail/VerifyPartnersEmail.yml index ae3a9cf1b6..9cf0173387 100644 --- a/apitest/src/main/resources/pms/VerifyPartnersEmail/VerifyPartnersEmail.yml +++ b/apitest/src/main/resources/pms/VerifyPartnersEmail/VerifyPartnersEmail.yml @@ -13,9 +13,9 @@ VerifyPartnersEmail: output: '{ "emailExists": true }' - Pms_VerifyPartnersEmail_invalid_role: + Pms_VerifyPartnersEmail_without_auth: endPoint: /v1/partnermanager/partners/email/verify - role: regproc + role: batch restMethod: put inputTemplate: pms/VerifyPartnersEmail/verifyPartnersEmail outputTemplate: pms/error @@ -26,7 +26,7 @@ VerifyPartnersEmail: output: '{ "errors": [ { - "errorCode": "KER-ATH-403" + "errorCode": "KER-ATH-401" } ] }'