From 0eb288024dc34a764c04b95b80226214327018ba Mon Sep 17 00:00:00 2001
From: "vinay.bhardwaj" <vinay.bhardwaj@ayanworks.com>
Date: Thu, 9 Jun 2022 17:03:35 +0530
Subject: [PATCH] Attestation Manager BDD Changes

---
 .../credentialDef/createCredentialDef.feature                  | 3 +++
 .../credentialDef/findCredentialDef.feature                    | 2 ++
 .../credentialDef/findCredentialDefById.feature                | 2 ++
 .../issue-credential/acceptOfferCredential.feature             | 1 +
 .../issue-credential/createCredentialType.feature              | 2 ++
 .../issue-credential/createOfferCredential.feature             | 1 +
 .../attestation-manager/issue-credential/getCredential.feature | 2 ++
 .../issue-credential/getCredentialsTypeDetails.feature         | 1 +
 .../issue-credential/getIssuedCredentials.feature              | 1 +
 .../issue-credential/offerMemberShipCredentials.feature        | 1 +
 .../issue-credential/updateSchemaIdByType.feature              | 1 +
 .../issue-credential/webHookCredentials.feature                | 2 ++
 features/attestation-manager/schemas/createSchema.feature      | 3 +++
 features/attestation-manager/schemas/findSchemaById.feature    | 2 ++
 features/attestation-manager/schemas/findSchemas.feature       | 1 +
 features/attestation-manager/schemas/getDidsForSchema.feature  | 2 ++
 16 files changed, 27 insertions(+)

diff --git a/features/attestation-manager/credentialDef/createCredentialDef.feature b/features/attestation-manager/credentialDef/createCredentialDef.feature
index 5d124e7..9f8a9c0 100644
--- a/features/attestation-manager/credentialDef/createCredentialDef.feature
+++ b/features/attestation-manager/credentialDef/createCredentialDef.feature
@@ -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
diff --git a/features/attestation-manager/credentialDef/findCredentialDef.feature b/features/attestation-manager/credentialDef/findCredentialDef.feature
index 31f1105..5dac4c1 100644
--- a/features/attestation-manager/credentialDef/findCredentialDef.feature
+++ b/features/attestation-manager/credentialDef/findCredentialDef.feature
@@ -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
diff --git a/features/attestation-manager/credentialDef/findCredentialDefById.feature b/features/attestation-manager/credentialDef/findCredentialDefById.feature
index 7ea1abd..270c148 100644
--- a/features/attestation-manager/credentialDef/findCredentialDefById.feature
+++ b/features/attestation-manager/credentialDef/findCredentialDefById.feature
@@ -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.
diff --git a/features/attestation-manager/issue-credential/acceptOfferCredential.feature b/features/attestation-manager/issue-credential/acceptOfferCredential.feature
index c5f1b64..a30ce0d 100644
--- a/features/attestation-manager/issue-credential/acceptOfferCredential.feature
+++ b/features/attestation-manager/issue-credential/acceptOfferCredential.feature
@@ -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
diff --git a/features/attestation-manager/issue-credential/createCredentialType.feature b/features/attestation-manager/issue-credential/createCredentialType.feature
index 205a448..2231f0a 100644
--- a/features/attestation-manager/issue-credential/createCredentialType.feature
+++ b/features/attestation-manager/issue-credential/createCredentialType.feature
@@ -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
diff --git a/features/attestation-manager/issue-credential/createOfferCredential.feature b/features/attestation-manager/issue-credential/createOfferCredential.feature
index bdea74e..4354f25 100644
--- a/features/attestation-manager/issue-credential/createOfferCredential.feature
+++ b/features/attestation-manager/issue-credential/createOfferCredential.feature
@@ -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
diff --git a/features/attestation-manager/issue-credential/getCredential.feature b/features/attestation-manager/issue-credential/getCredential.feature
index aa13729..9f503d9 100644
--- a/features/attestation-manager/issue-credential/getCredential.feature
+++ b/features/attestation-manager/issue-credential/getCredential.feature
@@ -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
diff --git a/features/attestation-manager/issue-credential/getCredentialsTypeDetails.feature b/features/attestation-manager/issue-credential/getCredentialsTypeDetails.feature
index a6c6608..5c832c4 100644
--- a/features/attestation-manager/issue-credential/getCredentialsTypeDetails.feature
+++ b/features/attestation-manager/issue-credential/getCredentialsTypeDetails.feature
@@ -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
diff --git a/features/attestation-manager/issue-credential/getIssuedCredentials.feature b/features/attestation-manager/issue-credential/getIssuedCredentials.feature
index 0e6ff8b..18e4260 100644
--- a/features/attestation-manager/issue-credential/getIssuedCredentials.feature
+++ b/features/attestation-manager/issue-credential/getIssuedCredentials.feature
@@ -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
diff --git a/features/attestation-manager/issue-credential/offerMemberShipCredentials.feature b/features/attestation-manager/issue-credential/offerMemberShipCredentials.feature
index 4b65706..96a06ff 100644
--- a/features/attestation-manager/issue-credential/offerMemberShipCredentials.feature
+++ b/features/attestation-manager/issue-credential/offerMemberShipCredentials.feature
@@ -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
diff --git a/features/attestation-manager/issue-credential/updateSchemaIdByType.feature b/features/attestation-manager/issue-credential/updateSchemaIdByType.feature
index 80ac762..8a5fa42 100644
--- a/features/attestation-manager/issue-credential/updateSchemaIdByType.feature
+++ b/features/attestation-manager/issue-credential/updateSchemaIdByType.feature
@@ -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
diff --git a/features/attestation-manager/issue-credential/webHookCredentials.feature b/features/attestation-manager/issue-credential/webHookCredentials.feature
index 8b5e7c7..97102b2 100644
--- a/features/attestation-manager/issue-credential/webHookCredentials.feature
+++ b/features/attestation-manager/issue-credential/webHookCredentials.feature
@@ -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.
diff --git a/features/attestation-manager/schemas/createSchema.feature b/features/attestation-manager/schemas/createSchema.feature
index ff43efd..c847dc7 100644
--- a/features/attestation-manager/schemas/createSchema.feature
+++ b/features/attestation-manager/schemas/createSchema.feature
@@ -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
diff --git a/features/attestation-manager/schemas/findSchemaById.feature b/features/attestation-manager/schemas/findSchemaById.feature
index 89bd959..51cdb9b 100644
--- a/features/attestation-manager/schemas/findSchemaById.feature
+++ b/features/attestation-manager/schemas/findSchemaById.feature
@@ -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.
diff --git a/features/attestation-manager/schemas/findSchemas.feature b/features/attestation-manager/schemas/findSchemas.feature
index 8ebd914..384c8c8 100644
--- a/features/attestation-manager/schemas/findSchemas.feature
+++ b/features/attestation-manager/schemas/findSchemas.feature
@@ -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
diff --git a/features/attestation-manager/schemas/getDidsForSchema.feature b/features/attestation-manager/schemas/getDidsForSchema.feature
index 6476b50..55aebf6 100644
--- a/features/attestation-manager/schemas/getDidsForSchema.feature
+++ b/features/attestation-manager/schemas/getDidsForSchema.feature
@@ -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
-- 
GitLab