diff --git a/src/main/resources/REST/json/Credential.json b/src/main/resources/REST/json/Credential.json index 750589c7cdcdff0e27b48c706114507dfff7a053..9d1be176e26a3e85270078e167f18ae8e286b4b3 100644 --- a/src/main/resources/REST/json/Credential.json +++ b/src/main/resources/REST/json/Credential.json @@ -75,6 +75,26 @@ } } }, + "for_proof_incorrect_ID_symbols":{ + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://www.w3.org/2018/credentials/examples/v1", + "https://www.schema.org" + ], + "id": "http://example.edu/credentials/3732", + "type": ["VerifiableCredential", "UniversityDegreeCredential"], + "issuer": "did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation", + "issuanceDate": "2010-01-01T00:00:00Z", + "credentialSubject": { + "id": ":", + "allow": true, + "num": 123, + "array": { + "txt1": "1", + "txt2": "2" + } + } + }, "incorrect_id":{ "@context": [ "https://www.w3.org/2018/credentials/v1", diff --git a/src/test/resources/features/tsa/signer/v1/credential/proof/POST.feature b/src/test/resources/features/tsa/signer/v1/credential/proof/POST.feature index 53d77e5645bf73ae45f399d763b92293772df70f..fd29f96ed4364a46b9eec72f8109cebd8946b385 100644 --- a/src/test/resources/features/tsa/signer/v1/credential/proof/POST.feature +++ b/src/test/resources/features/tsa/signer/v1/credential/proof/POST.feature @@ -25,26 +25,18 @@ Feature: API - TSA - Signer credential proof - v1/credential/proof POST Background: Given we are testing the TSA Signer Api - Scenario: TSA - create credential proof - Positive - When I load the REST request {Credential.json} with profile {for_proof} + Scenario Outline: TSA - create credential proof <labelSuffix> - Positive + When I load the REST request {Credential.json} with profile {<profileOption>} And I create credential proof via TSA Signer API Then the status code should be {200} - And the response is valid according to the {Signer_CredentialProof_schema.json} REST schema + And the response is valid according to the {<schema>} REST schema And the field {proof.verificationMethod} has the value {did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1} - Scenario: TSA - create credential proof alumni of - Positive - When I load the REST request {Credential.json} with profile {for_proof_alumni} - And I create credential proof via TSA Signer API - Then the status code should be {200} - And the response is valid according to the {Signer_CredentialProof_alumni_schema.json} REST schema - And the field {proof.verificationMethod} has the value {did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1} - - Scenario: TSA - create credential proof without ID - Positive - When I load the REST request {Credential.json} with profile {for_proof_without_ID} - And I create credential proof via TSA Signer API - Then the status code should be {200} - And the response is valid according to the {Signer_CredentialProof_without_ID_schema.json} REST schema - And the field {proof.verificationMethod} has the value {did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1} + Examples: + | labelSuffix | profileOption | schema | + | | for_proof | Signer_CredentialProof_schema.json | + | alumni of | for_proof_alumni | Signer_CredentialProof_alumni_schema.json | + | without ID | for_proof_without_ID | Signer_CredentialProof_without_ID_schema.json | @negative Scenario: TSA - create credential proof with empty body - Negative @@ -54,8 +46,13 @@ Feature: API - TSA - Signer credential proof - v1/credential/proof POST And the field {message} contains the value {credential type of unknown structure} @negative - Scenario: TSA - create credential proof with incorrect ID (space)- Negative - When I load the REST request {Credential.json} with profile {for_proof_incorrect_ID_space} + Scenario Outline: TSA - create credential proof with incorrect ID (<labelSuffix>)- Negative + When I load the REST request {Credential.json} with profile {<profileOption>} And I create credential proof via TSA Signer API Then the status code should be {400} And the field {message} has the value {invalid format of subject id} + + Examples: + | labelSuffix | profileOption | + | space | for_proof_incorrect_ID_space | + | symbols | for_proof_incorrect_ID_symbols | \ No newline at end of file diff --git a/src/test/resources/features/tsa/signer/v1/credential/verify/POST.feature b/src/test/resources/features/tsa/signer/v1/credential/verify/POST.feature index 8f241deea2c24a55c7e6525c54bb913026a87ce2..06a4288073437eada565a6d36df3135a55637d23 100644 --- a/src/test/resources/features/tsa/signer/v1/credential/verify/POST.feature +++ b/src/test/resources/features/tsa/signer/v1/credential/verify/POST.feature @@ -37,36 +37,16 @@ Feature: API - TSA - Signer credential verify - v1/credential/verify POST And the field {valid} has the value {true} @negative - Scenario: TSA - verify credential proof with missing proof - Negative - When I load the REST request {Credential.json} with profile {missing_proof} + Scenario Outline: TSA - verify credential proof with <labelSuffix> - Negative + When I load the REST request {Credential.json} with profile {<profileOption>} And I verify credential proof via TSA Signer API Then the status code should be {400} - And the field {message} contains the value {verifiable credential must have proof section} - - @negative - Scenario: TSA - verify credential proof with missing proof - Negative - When I load the REST request {Credential.json} with profile {modified_ID} - And I verify credential proof via TSA Signer API - Then the status code should be {400} - And the field {message} contains the value {invalid signature} - - @negative - Scenario: TSA - verify credential proof with modified issuanceDate field - Negative - When I load the REST request {Credential.json} with profile {modified_issuanceDate} - And I verify credential proof via TSA Signer API - Then the status code should be {400} - And the field {message} contains the value {invalid signature} - - @negative - Scenario: TSA - verify credential proof with modified issuanceDate field - Negative - When I load the REST request {Credential.json} with profile {modified_credentialSubject_allow} - And I verify credential proof via TSA Signer API - Then the status code should be {400} - And the field {message} contains the value {invalid signature} - - @negative - Scenario: TSA - verify credential proof with modified issuanceDate field - Negative - When I load the REST request {Credential.json} with profile {modified_credentialSubject_array} - And I verify credential proof via TSA Signer API - Then the status code should be {400} - And the field {message} contains the value {invalid signature} + And the field {message} contains the value {<messageText>} + + Examples: + | labelSuffix | profileOption | messageText | + | missing proof | missing_proof | verifiable credential must have proof section | + | modified ID | modified_ID | invalid signature | + | modified issuanceDate field | modified_issuanceDate | invalid signature | + | modified allow field | modified_credentialSubject_allow | invalid signature | + | modified array field | modified_credentialSubject_array | invalid signature | \ No newline at end of file diff --git a/src/test/resources/features/tsa/signer/v1/presentation/proof/POST.feature b/src/test/resources/features/tsa/signer/v1/presentation/proof/POST.feature index 32b4d2163130e9343ef12ea5ff77df4a7b90b3b4..883bb71309007afc325272f3044623ecb41e2833 100644 --- a/src/test/resources/features/tsa/signer/v1/presentation/proof/POST.feature +++ b/src/test/resources/features/tsa/signer/v1/presentation/proof/POST.feature @@ -25,25 +25,18 @@ Feature: API - TSA - Signer presentation proof - v1/presentation/proof POST Background: Given we are testing the TSA Signer Api - Scenario: TSA - create presentation proof - Positive - When I load the REST request {Presentation.json} with profile {for_proof} + Scenario Outline: TSA - create presentation proof <labelSuffix> - Positive + When I load the REST request {Presentation.json} with profile {<profileOption>} And I create presentation proof via TSA Signer API Then the status code should be {200} - And the response is valid according to the {Signer_PresentationProof_schema.json} REST schema + And the response is valid according to the {<schema>} REST schema And the field {proof.verificationMethod} has the value {did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1} - Scenario: TSA - create presentation proof alumni of - Positive - When I load the REST request {Presentation.json} with profile {for_proof_alumni} - And I create presentation proof via TSA Signer API - Then the status code should be {200} - And the response is valid according to the {Signer_PresentationProof_schema_alumni.json} REST schema - - Scenario: TSA - create presentation proof without ID - Positive - When I load the REST request {Presentation.json} with profile {for_proof_without_ID} - And I create presentation proof via TSA Signer API - Then the status code should be {200} - And the response is valid according to the {Signer_PresentationProof_schema.json} REST schema - And the field {proof.verificationMethod} has the value {did:web:gaiax.vereign.com:tsa:policy:policy:example:returnDID:1.0:evaluation#key1} + Examples: + | labelSuffix | profileOption | schema | + | | for_proof | Signer_PresentationProof_schema.json | + | alumni of | for_proof_alumni | Signer_PresentationProof_schema_alumni.json | + | without ID | for_proof_without_ID | Signer_PresentationProof_schema.json | @negative Scenario: TSA - validate presentation proof with empty body - Negative @@ -53,15 +46,13 @@ Feature: API - TSA - Signer presentation proof - v1/presentation/proof POST And the field {message} contains the value {verifiable presentation is not valid} @negative - Scenario: TSA - create presentation proof with incorrect ID (space) - Negative - When I load the REST request {Presentation.json} with profile {for_proof_incorrect_ID_space} + Scenario Outline: TSA - create presentation proof with incorrect ID (<labelSuffix>) - Negative + When I load the REST request {Presentation.json} with profile {<profileOption>} And I create presentation proof via TSA Signer API Then the status code should be {400} And the field {message} has the value {invalid format of subject id} - @negative - Scenario: TSA - create presentation proof with incorrect ID (symbols) - Negative - When I load the REST request {Presentation.json} with profile {for_proof_incorrect_ID_symbols} - And I create presentation proof via TSA Signer API - Then the status code should be {400} - And the field {message} has the value {invalid format of subject id} + Examples: + | labelSuffix | profileOption | + | space | for_proof_incorrect_ID_space | + | symbols | for_proof_incorrect_ID_symbols | \ No newline at end of file diff --git a/src/test/resources/features/tsa/signer/v1/presentation/verify/POST.feature b/src/test/resources/features/tsa/signer/v1/presentation/verify/POST.feature index 73605f18c54c68e8359a8d30b12c291fd7d85103..2f5c0b8c68007161edf6f8c77c018d4a4371d865 100644 --- a/src/test/resources/features/tsa/signer/v1/presentation/verify/POST.feature +++ b/src/test/resources/features/tsa/signer/v1/presentation/verify/POST.feature @@ -37,50 +37,18 @@ Feature: API - TSA - Signer presentation verify - v1/presentation/verify POST And the field {valid} has the value {true} @negative - Scenario: TSA - verify presentation proof with missing proof - Negative - When I load the REST request {Presentation.json} with profile {missing_proof} + Scenario Outline: TSA - verify presentation proof with <labelSuffix> - Negative + When I load the REST request {Presentation.json} with profile {<profileOption>} And I verify presentation proof via TSA Signer API And the status code should be {400} - And the field {message} has the value {verifiable presentation must have proof section} - - @negative - Scenario: TSA - verify presentation proof with modified ID field - Negative - When I load the REST request {Presentation.json} with profile {modified_ID} - And I verify presentation proof via TSA Signer API - And the status code should be {400} - And the field {message} contains the value {invalid signature} - - @negative - Scenario: TSA - verify presentation proof with modified issuanceDate field - Negative - When I load the REST request {Presentation.json} with profile {modified_issuanceDate} - And I verify presentation proof via TSA Signer API - And the status code should be {400} - And the field {message} contains the value {invalid signature} - - @negative - Scenario: TSA - verify presentation proof with modified first credentialSubject.allow field - Negative - When I load the REST request {Presentation.json} with profile {modified_credentialSubject_1_allow} - And I verify presentation proof via TSA Signer API - And the status code should be {400} - And the field {message} contains the value {invalid signature} - - @negative - Scenario: TSA - verify presentation proof with modified second credentialSubject.allow field - Negative - When I load the REST request {Presentation.json} with profile {modified_credentialSubject_2_allow} - And I verify presentation proof via TSA Signer API - And the status code should be {400} - And the field {message} contains the value {invalid signature} - - @negative - Scenario: TSA - verify presentation proof with modified first credentialSubject.ID field - Negative - When I load the REST request {Presentation.json} with profile {modified_credentialSubject_1_ID} - And I verify presentation proof via TSA Signer API - And the status code should be {400} - And the field {message} contains the value {invalid signature} - - @negative - Scenario: TSA - verify presentation proof with modified second credentialSubject.ID field - Negative - When I load the REST request {Presentation.json} with profile {modified_credentialSubject_2_ID} - And I verify presentation proof via TSA Signer API - And the status code should be {400} - And the field {message} contains the value {invalid signature} + And the field {message} contains the value {<messageText>} + + Examples: + | labelSuffix | profileOption | messageText | + | missing proof | missing_proof | verifiable presentation must have proof section | + | modified ID | modified_ID | invalid signature | + | modified issuanceDate field | modified_issuanceDate | invalid signature | + | modified first allow field | modified_credentialSubject_1_allow | invalid signature | + | modified second allow field | modified_credentialSubject_2_allow | invalid signature | + | modified first credentialSubject.ID field | modified_credentialSubject_1_ID | invalid signature | + | modified second credentialSubject.ID field | modified_credentialSubject_2_ID | invalid signature | \ No newline at end of file