Skip to content
Snippets Groups Projects
Commit b68cc4c9 authored by Vinay Bhardwaj's avatar Vinay Bhardwaj Committed by Suneet Bendre
Browse files

Added BDDs for Attestation Manager

parent 46eb9aa3
No related branches found
No related tags found
2 merge requests!11sync,!2Added BDDs for Attestation Manager
Showing
with 253 additions and 0 deletions
As an OCM user
I want to create a new Credential Definition
Feature: Create a new Credential Definition
Create a new Credential Definition on Ledger and save details in DB
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.
And store the details in DB.
And I should get the HTTP status code 201 Created and the created Credential Definition Details.
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
As an OCM user
I want to get all Credential Definitions by schema id
Feature: Get All Credential Definitions by schema id
Get All Credential Definitions from the DB by given 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
As an OCM user
I want to find Credential Definition by id
Feature: Get Credential Definition by Id
Get Credential Definition by the given cred_def_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.
As an OCM user
I want to accept a credential offer
Feature: Accept offer credential
Accept a credential offer
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
As an OCM user
I want to create a new CredentialType
Feature: Create a new CredentialType
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
As an OCM user
I want to create credential offer
Feature: Create offer credential
Create a credential offer
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
As an OCM user
I want to get credentials
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
As an OCM user
I want to get the credentialType details of a given type
Feature: Get CredentialType details
Get the details of credentialType of given type
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
As an OCM user
I want to get the credentials issued to a given connection
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
As an OCM user
I want to offer MemberShip Credentials
Feature: Offer Membership Credential
Offer a membership credential to User
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
As an OCM user
I want to update schema_id in credentialType of given type
Feature: Update schema_id by type
update schema_id in credentialType for given 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
As an OCM user
I want to save the credential details from Webhook emitted by AFJ Agent
Feature: Credentials Webhook
Credential Webhook Emitted by AFJ
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.
As an OCM user
I want to create a new Schema
Feature: Create a new Schema
Create a new Schema on Ledger and save details in DB
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.
And store the details in DB.
And I should get the HTTP status code 201 Created and the created Schema Details.
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
As an OCM user
I want to get the Schema by id
Feature: Get Schema by Id
Get Schema by the given schema 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.
As an OCM user
I want to get list of all the Schemas
Feature: Get All Schemas
Get All Schemas from the DB
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
As an OCM user
I want to get all principal DIDs for a given schema id
Feature: Get all DIDs for Schema
Get all principal DIDs for a given schema id
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