From fe6a8fd8f2ca090662c938845243dd37f05b8f33 Mon Sep 17 00:00:00 2001
From: Sagar Khole <sagar.khole@ayanworks.com>
Date: Wed, 25 May 2022 11:19:00 +0530
Subject: [PATCH] BDD review

---
 features/connection/PCMConnection.feature     | 23 ++++++++++++
 .../SchedularToDeleteConnection.feature       |  9 +++++
 features/connection/getConnection.feature     | 35 +++++++++----------
 .../connection/membershipCredential.feature   | 23 ------------
 4 files changed, 49 insertions(+), 41 deletions(-)
 create mode 100644 features/connection/PCMConnection.feature
 create mode 100644 features/connection/SchedularToDeleteConnection.feature
 delete mode 100644 features/connection/membershipCredential.feature

diff --git a/features/connection/PCMConnection.feature b/features/connection/PCMConnection.feature
new file mode 100644
index 0000000..325cc43
--- /dev/null
+++ b/features/connection/PCMConnection.feature
@@ -0,0 +1,23 @@
+ As a PCM user, 
+    I want to register with an organization
+    So that I can leverage GAIA-X ecosystem
+
+    Scenario: I want to become a member of an organization (a GAIA-X Participant)
+        Given PCM Application should be configured on the user device.
+        And OCM admin generates QR code ( with parameter alias set to 'member') and sends to PCM register email address.
+        When  PCM Application scans the provided QR code.
+        Then Pairwise DID and ver key is exchanged between the agents. 
+        And the Connection is established between the PCM aries agent and organization aries agent.
+        And connection state moves to complete state.
+        And Principal membership credentials are issued.
+
+    Scenario: I want to subscribe to a service of an organization (a GAIA-X Participant) 
+        Given PCM User should be member of an organization.
+        And OCM admin/portal generates QR code ( with parameter alias set to 'subscriber') and email/display on portal.
+        When  PCM Application scans the provided QR code.
+        Then Pairwise DID and ver key is exchanged between the agents. 
+        And the Connection is established between PCM aries agent and organization aries agent.
+        And connection state moves to complete state.
+        And Principal membership verification to make connection trusted.
+        And OCM admin issues the verifiable credential over a trusted connection.
+
diff --git a/features/connection/SchedularToDeleteConnection.feature b/features/connection/SchedularToDeleteConnection.feature
new file mode 100644
index 0000000..0b82ab8
--- /dev/null
+++ b/features/connection/SchedularToDeleteConnection.feature
@@ -0,0 +1,9 @@
+Scheduler is running on Background to delete Non-trusted and Non-complete connections.
+
+    Scenario: Delete a Non-complete connection.
+    When connection does not goes in complete state within 30 minutes
+    Then connection will get deleted from database.
+
+    Scenario: Delete a Non-trusted connection.
+    When connection does not goes in trusted state within 30 minutes
+    Then connection will get deleted from database.
diff --git a/features/connection/getConnection.feature b/features/connection/getConnection.feature
index b1fbcc8..03c738d 100644
--- a/features/connection/getConnection.feature
+++ b/features/connection/getConnection.feature
@@ -1,22 +1,21 @@
-Feature: Get Connection API
-    Return the list of connections or single conneection created on OCM environment
+  Get Connection details
+    Return the list of connections or single connection created on the OCM environment
 
-    Scenario: Provide validated page and pageSize.
-        When  passed valid page.
-        And   passed valid pageSize.
-        Then  should get connection list.
+     Scenario: Connection details by ID.
+        When  passed valid connection ID.
+        Then  returns connection details.
 
-    Scenario: Provide validated page and pageSize.
-        When  passed valid page.
-        And   passed valid pageSize.
-        Then  should get http status 404.
+    Scenario: Connection details.
+        When  passed valid pageSize and Number of records.
+        Then  returns a list of connection details.
 
-    Scenario: Provide invalid page and pageSize
-        When passed invalid page.
-        And  passed invalid pageSize.
-        Then should return no data available with status code 404(Not Found).
+        Scenario: Connection details with status.
+        When passed valid pageSize and Number of records.
+        And status
+        Then returns a list of connection details with provided status.
+
+
+    Scenario: Connection details by ID.
+        When  passed valid connection ID.
+        Then  returns connection details.
 
-    Scenario: Not Provide Connction ID or participant DID
-        When not provid connection ID
-        Then should return message "connection ID / participant DID must be provided" with status code 400.
-//Need to discuess with suneet (participant DID) .
\ No newline at end of file
diff --git a/features/connection/membershipCredential.feature b/features/connection/membershipCredential.feature
deleted file mode 100644
index f3ec6b5..0000000
--- a/features/connection/membershipCredential.feature
+++ /dev/null
@@ -1,23 +0,0 @@
-Feature: Create connection invitation URL
-
-    Scenario: Create connection invitation URL
-        Given I have create connection invitation URL as member
-        When  I have pass Alis as "member"
-        Then the Connection Invitation URL should be created.
-        And if I accepts the connection it should go in complete state.
-
-
-
-    Scenario: Create connection invitation URL
-        Given I have create connection invitation URL as subscriber
-        When  I have pass Alis as "subscriber"
-        Then the Connection Invitation URL should be created.
-        And if I accepts the connection it should go in complete state.
-
-    Scenario: Create connection invitation URL.
-        Given I have create connection invitation URL
-        When I have not pass alis as a member.
-        When I have not pass alis as a subscriber.
-        And  the Connection Invitation URL should be created.
-        And If I accepts the connection it should go in complete state.
-        But connection will never goes in trusted state.
-- 
GitLab