Skip to content
Snippets Groups Projects
Commit 0eb28802 authored by Vinay Bhardwaj's avatar Vinay Bhardwaj
Browse files

Attestation Manager BDD Changes

parent f8773733
No related branches found
No related tags found
3 merge requests!11sync,!6Feature/attestation manager,!2Added BDDs for Attestation Manager
Showing
with 27 additions and 0 deletions
......@@ -6,6 +6,7 @@ Feature: Create a new Credential Definition
Scenario: Provide valid and required Credential Definition Details
Given I have passed all required credential definition details.
# src\credentialDef\controller\controller.ts -> REST API with POST method -> credentialDef/
When passed all valid credential definition details.
Then credential definition should be created on the Ledger with the given details.
And should return the newly created credential definition id.
......@@ -14,10 +15,12 @@ Feature: Create a new Credential Definition
Scenario: Provide invalid schemaID, name, created_by, is_revokable or is_auto_issue
Given I have passed schemaID, name, created_by, is_revokable and is_auto_issue.
# src\credentialDef\controller\controller.ts -> REST API with POST method -> credentialDef/
When passed invalid schemaID, name, created_by, is_revokable or is_auto_issue.
Then I should get HTTP status code 400 Bad Request.
Scenario: Provide name and schemaID of the existing Credential Definition.
Given I have passed all required credential definition details.
# src\credentialDef\controller\controller.ts -> REST API with POST method -> credentialDef/
When passed name and schemaID of the existing Credential Definition.
Then I should get HTTP status code 409 Conflict.
\ No newline at end of file
......@@ -6,10 +6,12 @@ Feature: Get All Credential Definitions by schema id
Scenario: Provide valid schema id, page and page size.
Given I have passed the required schema id, page and page size.
# src\credentialDef\controller\controller.ts -> REST API with GET method -> credentialDef/
When passed details are valid.
Then I should get the HTTP status code 200 Ok and list of Credential Definitions from the DB.
Scenario: Provide invalid schema id.
Given I have passed the required schema id.
# src\credentialDef\controller\controller.ts -> REST API with GET method -> credentialDef/
When passed schema id is invalid.
Then I should get the HTTP status code 404 NOT Found.
\ No newline at end of file
......@@ -6,10 +6,12 @@ Feature: Get Credential Definition by Id
Scenario: Provide valid cred_def_id.
Given I have passed the required cred_def_id.
# src\credentialDef\controller\controller.ts -> REST API with GET method -> credentialDef/:id
When passed cred_def_id is valid.
Then I should get the HTTP status code 200 Ok and Credential Definition from the DB.
Scenario: Provide invalid cred_def_id.
Given I have passed the required cred_def_id.
# src\credentialDef\controller\controller.ts -> REST API with GET method -> credentialDef/:id
When passed cred_def_id is invalid.
Then I should get the HTTP status code 404 Not Found.
......@@ -6,6 +6,7 @@ Feature: Accept offer credential
Scenario: Provide valid and required credentialId
Given I have passed all required details.
# src\issue-credential\controller\controller.ts -> REST API with POST method -> accept-request/
When passed all valid accept offer credential details.
Then credential offer should get accepted.
And I should get the HTTP status code 202 Accepted and the updated credential offer Details.
\ No newline at end of file
......@@ -6,11 +6,13 @@ Feature: Create a new CredentialType
Scenario: Provide valid and required CredentialType Details
Given I have passed all required credentialType details.
# src\issue-credential\controller\controller.ts -> REST API with POST method -> credentialType/
When passed all valid credentialType details.
Then credentialType should be created in DB.
And I should get the HTTP status code 201 Created and the created CredentialType Details.
Scenario: Provide invalid schema_id or type
Given I have passed schema_id and type.
# src\issue-credential\controller\controller.ts -> REST API with POST method -> credentialType/
When passed invalid schema_id or type.
Then I should get HTTP status code 400 Bad Request.
\ No newline at end of file
......@@ -6,6 +6,7 @@ Feature: Create offer credential
Scenario: Provide valid and required connectionId, credentialDefinitionId, comment, preview and autoAcceptCredential
Given I have passed all required offer credential details.
# src\issue-credential\controller\controller.ts -> REST API with POST method -> create-offer-credential/
When passed all valid offer credential details.
Then credential offer should be sent to the given connection.
And I should get the HTTP status code 201 Created and the created credential offer Details.
\ No newline at end of file
......@@ -5,10 +5,12 @@ Feature: Get credential
Scenario: Provide valid credential_id
Given I have passed all required details.
# src\issue-credential\controller\controller.ts -> REST API with POST method -> credential/:id
When passed valid credential_id.
Then I should get the HTTP status code 200 Ok and the credential Details.
Scenario: Provide invalid credential_id
Given I have passed all required details.
# src\issue-credential\controller\controller.ts -> REST API with POST method -> credential/:id
When passed invalid credential_id.
Then I should get the HTTP status code 404 Not Found.
\ No newline at end of file
......@@ -6,5 +6,6 @@ Feature: Get CredentialType details
Scenario: Provide valid and required type
Given I have passed type.
# src\issue-credential\controller\controller.ts -> NATS call for topic 'ATTESTATION_MANAGER_SERVICE/getCredentialsTypeDetails'
When passed valid type.
Then I should get the details of the CredentialType.
\ No newline at end of file
......@@ -5,5 +5,6 @@ Feature: Get issued credentials of a given connection
Scenario: Provide valid and required connection_id
Given I have passed connection_id.
# src\issue-credential\controller\controller.ts -> NATS call for topic 'ATTESTATION_MANAGER_SERVICE/getIssueCredentials'
When passed valid connection_id.
Then I should get the list of Credentials Issued.
\ No newline at end of file
......@@ -6,6 +6,7 @@ Feature: Offer Membership Credential
Scenario: Provide valid and required status, connectionId, theirLabel and participantDid
Given AFJ Agent NATS Publisher have passed all required offer membership credential details.
# src\issue-credential\controller\controller.ts -> NATS call for topic 'ATTESTATION_MANAGER_SERVICE/offerMemberShipCredentials'
When passed all valid offer membership credential details.
Then credential offer should be sent to the given connection.
And I should get the HTTP status code 201 Created and the created membership credential offer Details.
\ No newline at end of file
......@@ -6,6 +6,7 @@ Feature: Update schema_id by type
Scenario: Provide valid and required schema_id and type
Given I have passed all required details.
# src\issue-credential\controller\controller.ts -> REST API with POST method -> updateSchemaIdByType/
When passed valid schema_id and type.
Then credentialType should be updated.
And I should get the HTTP status code 200 Ok and the updated credentialType Details.
\ No newline at end of file
......@@ -6,12 +6,14 @@ Feature: Credentials Webhook
Scenario: A new Credential is offered
Given AFJ Agent have passed created credential details.
# src\issue-credential\controller\controller.ts -> NATS call for topic 'ATTESTATION_MANAGER_SERVICE/CredentialStateChanged'
When passed credential state is OFFER_SENT.
Then credential should be created in DB.
And I should get the HTTP status code 201 Created and the created credential Details.
Scenario: A Credential's state is changed
Given AFJ have passed the updated credential details.
# src\issue-credential\controller\controller.ts -> NATS call for topic 'ATTESTATION_MANAGER_SERVICE/CredentialStateChanged'
When passed credential state is not OFFER_SENT.
Then credential state should be updated in DB.
And I should get the HTTP status code 202 Accepted and the updated credential Details.
......@@ -6,6 +6,7 @@ Feature: Create a new Schema
Scenario: Provide valid and required Schema Details
Given I have passed all required schema details.
# src\schemas\controller\controller.ts -> REST API with POST method -> schemas/
When passed all valid schema details.
Then schema should be created on the Ledger with the given details.
And should return the newly created Schema_ID.
......@@ -14,10 +15,12 @@ Feature: Create a new Schema
Scenario: Provide invalid name, created_by, version or attributes
Given I have passed name, created_by, version and attributes.
# src\schemas\controller\controller.ts -> REST API with POST method -> schemas/
When passed invalid name, created_by, version or attributes.
Then I should get the HTTP status code 400 Bad Request.
Scenario: Provide name and version of the existing Schema.
Given I have passed all required schema details.
# src\schemas\controller\controller.ts -> REST API with POST method -> schemas/
When passed name and version of the existing Schema.
Then I should get the HTTP status code 409 Conflict.
\ No newline at end of file
......@@ -6,10 +6,12 @@ Feature: Get Schema by Id
Scenario: Provide valid schema id.
Given I have passed the required schema id.
# src\schemas\controller\controller.ts -> REST API with GET method -> schemas/:id
When passed schema id is valid.
Then I should get the HTTP status code 200 Ok and Schema from the DB.
Scenario: Provide invalid schema id.
Given I have passed the required schema id.
# src\schemas\controller\controller.ts -> REST API with GET method -> schemas/:id
When passed schema id is invalid.
Then I should get the HTTP status code 404 Not Found.
......@@ -6,5 +6,6 @@ Feature: Get All Schemas
Scenario: Provide valid page and page size.
Given I have passed the required page and page size.
# src\schemas\controller\controller.ts -> REST API with GET method -> schemas/
When passed details are valid.
Then I should get the HTTP status code 200 Ok and list of Schemas from the DB.
\ No newline at end of file
......@@ -6,10 +6,12 @@ Feature: Get all DIDs for Schema
Scenario: Provide valid schema id.
Given I have passed the required schema id.
# src\schemas\controller\controller.ts -> REST API with GET method -> get-dids-for-schema/:id
When passed schema id is valid.
Then I should get the HTTP status code 200 Ok and Schema DIDs from the DB.
Scenario: Provide invalid schema id.
Given I have passed the required schema id.
# src\schemas\controller\controller.ts -> REST API with GET method -> get-dids-for-schema/:id
When passed schema id is invalid.
Then I should get the HTTP status code 404 Not Found.
\ 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