From fd94d759091056c5e019d8f0880f82f68e868ad1 Mon Sep 17 00:00:00 2001 From: Sagar Khole <sagar.khole@ayanworks.com> Date: Thu, 9 Jun 2022 14:03:04 +0530 Subject: [PATCH] connection manager BDD changes --- features/connection/PCMConnection.feature | 14 +++++++---- .../SchedularToDeleteConnection.feature | 2 ++ features/connection/createConnection.feature | 22 ------------------ .../connection/findByConnectionId.feature | 3 +++ features/connection/getConnection.feature | 7 +++--- .../connection/makeConnectionTrusted.feature | 3 +++ features/connection/updateConnection.feature | 23 ------------------- 7 files changed, 21 insertions(+), 53 deletions(-) delete mode 100644 features/connection/createConnection.feature delete mode 100644 features/connection/updateConnection.feature diff --git a/features/connection/PCMConnection.feature b/features/connection/PCMConnection.feature index 325cc43..f4c5bca 100644 --- a/features/connection/PCMConnection.feature +++ b/features/connection/PCMConnection.feature @@ -3,21 +3,27 @@ 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. + Given PCM Application should be configureameter alias set to 'member') and sends to PCM register email address. + When PCM Application scans the provided d on the user device. + # src/connections/controller/controller.ts-> Rest API POST METHOD -> NAME 'invitation-url' + And OCM admin generates QR code ( with parQR 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. + # Webhook call on topic 'CONNECTION_MANAGER_SERVICE/ConnectionStateChanged' And connection state moves to complete state. + # Nats call on topic 'PRINCIPAL_MANAGER_SERVICE/connectionCompleteStatus' 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. + # src/connections/controller/controller.ts-> Rest API POST METHOD -> NAME 'invitation-url' 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. + # Webhook call on topic 'CONNECTION_MANAGER_SERVICE/ConnectionStateChanged' And connection state moves to complete state. - And Principal membership verification to make connection trusted. + # Nats call on topic 'PROOF_MANAGER_SERVICE/sendMembershipProofRequest' + 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 index 0b82ab8..31e6483 100644 --- a/features/connection/SchedularToDeleteConnection.feature +++ b/features/connection/SchedularToDeleteConnection.feature @@ -2,8 +2,10 @@ Scheduler is running on Background to delete Non-trusted and Non-complete connec Scenario: Delete a Non-complete connection. When connection does not goes in complete state within 30 minutes + # /src/connections/scheduler/scheduler.service.ts -> expireNonCompleteConnection() Then connection will get deleted from database. Scenario: Delete a Non-trusted connection. When connection does not goes in trusted state within 30 minutes + # /src/connections/scheduler/scheduler.service.ts -> expireNonTrustedConnection() Then connection will get deleted from database. diff --git a/features/connection/createConnection.feature b/features/connection/createConnection.feature deleted file mode 100644 index b64bacd..0000000 --- a/features/connection/createConnection.feature +++ /dev/null @@ -1,22 +0,0 @@ -Feature: Webhook call for create connection - - Scenario: Received validated DTO from NATS call . - Given Webhook valid object . - When passed connection status as invited. - And passed valid connection id. - And role should be inviter. - Then should create the connection. - - Scenario: Received validated DTO from NATS call . - Given Webhook valid object . - When passed connection status as invited. - And passed invalid connection id. - And role should be inviter. - Then should return valid status code 400(BAD_REQUEST). - - Scenario: Received validated DTO from NATS call . - Given Webhook valid object . - When passed connection status as invited. - And passed valid connection id. - And role is invitee. - Then should return valid status code 400(BAD_REQUEST). \ No newline at end of file diff --git a/features/connection/findByConnectionId.feature b/features/connection/findByConnectionId.feature index ab8a278..02f676b 100644 --- a/features/connection/findByConnectionId.feature +++ b/features/connection/findByConnectionId.feature @@ -3,15 +3,18 @@ Feature: Get connection details By Id Scenario: Provide valid connection ID Given The connection ID available on agent database. + # src/connections/controller/controller.ts-> Nats call on topic 'CONNECTION_MANAGER_SERVICE/getConnectionById' When provide valid connection ID. Then should return connection details. Scenario: Provide invalid connection ID. Given The connection ID available. + # src/connections/controller/controller.ts-> Nats call on topic 'CONNECTION_MANAGER_SERVICE/getConnectionById' When provide invalid connection ID. Then should return no data found with satus code 404(Not Found). Scenario: Not Provide a connection ID. Given The connection ID available. + # src/connections/controller/controller.ts-> Nats call on topic 'CONNECTION_MANAGER_SERVICE/getConnectionById' When not provide connection ID. Then should return connection request required Connction ID with satus code 400. \ No newline at end of file diff --git a/features/connection/getConnection.feature b/features/connection/getConnection.feature index 03c738d..522f37f 100644 --- a/features/connection/getConnection.feature +++ b/features/connection/getConnection.feature @@ -2,20 +2,19 @@ Return the list of connections or single connection created on the OCM environment Scenario: Connection details by ID. + # src/connections/controller/controller.ts-> Rest API with Get Method -> connections/:connectionId? When passed valid connection ID. Then returns connection details. Scenario: Connection details. + # src/connections/controller/controller.ts-> Rest API with Get Method -> connections/:connectionId? When passed valid pageSize and Number of records. Then returns a list of connection details. Scenario: Connection details with status. + # src/connections/controller/controller.ts-> Rest API with Get Method -> connections/:connectionId? 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. - diff --git a/features/connection/makeConnectionTrusted.feature b/features/connection/makeConnectionTrusted.feature index c7edd16..9d88f54 100644 --- a/features/connection/makeConnectionTrusted.feature +++ b/features/connection/makeConnectionTrusted.feature @@ -3,14 +3,17 @@ Feature: Make connection trusted against connection ID. Scenario: Make connection trusted against connection ID. Given I have pass connection ID. + # src/connections/controller/controller.ts-> Nats call on topic 'CONNECTION_MANAGER_SERVICE/makeConnectionTrusted' When I have pass valid connection ID. Then should update current connection state to trusted state. Scenario: Make connection trusted against connection ID. Given I have pass connection ID. + # src/connections/controller/controller.ts-> Nats call on topic 'CONNECTION_MANAGER_SERVICE/makeConnectionTrusted' When I have pass invalid connection ID. Then should get http status 404(Not Found). Scenario: Make connection trusted against connection ID. + # src/connections/controller/controller.ts-> Nats call on topic 'CONNECTION_MANAGER_SERVICE/makeConnectionTrusted' Given I have not pass connection ID. Then should return connection request required Connction ID with state code 400(Bad request). \ No newline at end of file diff --git a/features/connection/updateConnection.feature b/features/connection/updateConnection.feature deleted file mode 100644 index 5ffb84d..0000000 --- a/features/connection/updateConnection.feature +++ /dev/null @@ -1,23 +0,0 @@ -Feature: Webhook call for update connection - - Scenario: Received validated DTO from NATS call . - Given Webhook valid object . - When passed valid connection status other than invited. - And passed valid connection id. - And role should be inviter. - Then should update the connection. - - Scenario: Received validated DTO from NATS call . - Given Webhook valid object . - When passed connection status as invited. - And passed invalid connection id. - And role should be inviter. - Then should return valid status code 404(NOT_FOUND). - - Scenario: Received validated DTO from NATS call . - Given Webhook valid object . - When passed valid connection status other than invited. - And passed valid connection id. - And role is invitee. - Then should return valid status code 400(BAD_REQUEST). - -- GitLab