Skip to content
Snippets Groups Projects
Commit 6f53a65a authored by Georgi Michev's avatar Georgi Michev
Browse files

Merge branch 'refactor-signer-tests' into 'main'

Refactor signer tests

See merge request !32
parents 56d1316f d7c47bd5
No related branches found
No related tags found
1 merge request!32Refactor signer tests
Pipeline #53350 passed with stage
in 4 minutes and 31 seconds
......@@ -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",
......
......@@ -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
......@@ -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
......@@ -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
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment