From 60484effc117f839e02cd38e682dedee9a3bfcea Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Wed, 10 Jul 2024 00:57:43 +0530 Subject: [PATCH 01/22] Create device-status-subscriptions Gherkin tests for device-reachability-status-subscriptions device-connectivity-status-subscriptions --- .../device-status-subscriptions | 168 ++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 code/Test_definitions/device-status-subscriptions diff --git a/code/Test_definitions/device-status-subscriptions b/code/Test_definitions/device-status-subscriptions new file mode 100644 index 00000000..296d0733 --- /dev/null +++ b/code/Test_definitions/device-status-subscriptions @@ -0,0 +1,168 @@ +@DeviceStatusSubscriptionSanity +Feature: CAMARA DeviceStatus Subscription API, v0.5.1 - Operation DeviceStatus + + @DeviceStatusSubscription_01_InRoamingEvent + Scenario: Check roaming event if the device roaming state changed to 'true' + Given Use BaseURL + When Create device status subscription for MSISDN +491601111111 and roaming-status event + Then Response code is 201 + Then Get device status subscription + Then Response code is 200 + When Wait 10 seconds + Then The callback notification application receives roaming-status event + Then The roaming status is true + Then The country name is + | DG | + | GU | + | US | + Then The country code is 310 + When Delete device status subscription + Then Response code is 204 + + @DeviceStatusSubscription_02_NotInRoamingEvent + Scenario: Check roaming event if the device roaming state changed to 'false' + Given Use BaseURL + When Create device status subscription for MSISDN +49160333333 and roaming-status event + Then Response code is 201 + Then Get device status subscription + Then Response code is 200 + When Wait 10 seconds + Then The callback notification application receives roaming-status event + Then The roaming status is false + Then The country name is + | DG | + | GU | + | US | + Then The country code is 310 + When Delete device status subscription + Then Response code is 204 + + @DeviceStatusSubscription_03_CountryChangeEvent + Scenario: Check the country code event if the device in roaming changes a country + Given Use BaseURL + When Create device status subscription for MSISDN +49160222222 and change-country event + Then Response code is 201 + Then Get device status subscription + Then Response code is 200 + When Wait 10 seconds + Then The callback notification application receives change-country event + Then The country name is + | DE | + Then The country code is 262 + When Delete device status subscription + Then Response code is 204 + + @DeviceStatusSubscription_04_ConnectivityDataEvent + Scenario: Check connectivity event if the device connectivity is changed to Data usage + Given Use BaseURL + When Create device status subscription for MSISDN +491601111111 and connectivity-data event + Then Response code is 201 + Then Get device status subscription + Then Response code is 200 + When Wait 10 seconds + Then The callback notification application receives connectivity-data event + When Delete device status subscription + Then Response code is 204 + + @DeviceStatusSubscription_05_ConnectivitySmsEvent + Scenario: Check connectivity event if the device connectivity is changed to SMS usage + Given Use BaseURL + When Create device status subscription for MSISDN +491602222222 and connectivity-sms event + Then Response code is 201 + Then Get device status subscription + Then Response code is 200 + When Wait 10 seconds + Then The callback notification application receives connectivity-sms event + When Delete device status subscription + Then Response code is 204 + + @DeviceStatusSubscription_06_ConnectivityDisconnectedEvent + Scenario: Check connectivity event if the device connectivity is changed to disconnected + Given Use BaseURL + When Create device status subscription for MSISDN +491609999999 and connectivity-disconnected event + Then Response code is 201 + Then Get device status subscription + Then Response code is 200 + When Wait 10 seconds + Then The callback notification application receives connectivity-disconnected event + #When Delete device status subscription + #Then Response code is 204 + + @DeviceStatusSubscription_07_SubscriptionEndsEvent + Scenario: Check device status subscription ends event + Given Use BaseURL + When Create device status subscription for duration of 2 seconds + Then Response code is 201 + Then Get device status subscription + Then Response code is 200 + When Wait 10 seconds + Then The callback notification application receives subscription-ends event + Then Get device status subscription + Then Response code is 404 + + + @DeviceStatusSubscription_08_GetSubscriptions + Scenario: Get all device status event subscriptions + Given Use BaseURL + When Create device status subscription for a valid access token with client-id-1, MSISDN +49160222222 and change-country event + Then Response code is 201 + When Create device status subscription for a valid access token with client-id-1, MSISDN +49160333333 and roaming-status event + Then Response code is 201 + When Create device status subscription for a valid access token with client-id-2, MSISDN +491602222222 and connectivity-sms event + Then Response code is 201 + When Get all device status subscriptions for client-id-1 + Then Response code is 200 + Then Number of subscriptions of client-id-1 is 2 + When Get all device status subscriptions for client-id-2 + Then Response code is 200 + Then Number of subscriptions of client-id-2 is 1 + Then Delete subscriptions + + @DeviceStatusSubscription_09_GetSubscriptionsForNotExistingSubscription + Scenario: Get all device status subscriptions for a client that does not have any subscriptions + Given Use BaseURL + When Create device status subscription for a valid access token with client-id-1, MSISDN +491601111111 and connectivity-data event + Then Response code is 201 + When Get all device status subscriptions for client-id-2 + Then Response code is 200 + Then Number of subscriptions of client-id-2 is 0 + Then Delete subscriptions + + @DeviceStatusSubscription_10_GetSubscriptionsForInvalidToken + Scenario: Get all device status subscriptions for an invalid access token + Given Use BaseURL + When Create device status subscription for a valid access token with client-id-1, MSISDN +49160222222 and change-country event + Then Response code is 201 + When Get all device status subscriptions for an invalid access token + Then Response code is 403 + Then Delete subscriptions + + @DeviceStatusSubscription_11_DeviceIncorrectMsisdn + Scenario: Device status request for an incorrect msisdn + Given Use BaseURL + When Request device status with incorrect msisdn in json payload + Then Response code is 400 + + @DeviceStatusSubscription_12_DeviceForPastSubscriptionExpirationTime + Scenario: Device status request for past subscriptionExpireTime + Given Use BaseURL + When Request create device status subscription for subscriptionExpireTime in th past + Then Response code is 400 + + @DeviceStatusSubscription_13_DeviceWithNoMsisdn + Scenario: Device status request without MSISDN + Given Use BaseURL + When Request create device status subscription without MSISDN + Then Response code is 400 + + @DeviceStatusSubscription_14_GetSubscriptionsSMS + Scenario: Get all device status event subscriptions + Given Use BaseURL + When Create device status subscription for a valid access token with client-id-2, MSISDN +491609999999 and connectivity-sms event + Then Response code is 201 + + @DeviceStatusSubscription_15_GetSubscriptionsDisconnect + Scenario: Get all device status event subscriptions + Given Use BaseURL + When Create device status subscription for a valid access token with client-id-2, MSISDN +491603333333 and connectivity-disconnected event + Then Response code is 201 From e767d0e40273d6575a400da0c646bceb4ed06b6b Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Tue, 23 Jul 2024 14:55:41 +0530 Subject: [PATCH 02/22] Update and rename device-status-subscriptions to device-roaming-status-subscriptions.feature --- ...evice-roaming-status-subscriptions.feature | 150 ++++++++++++++++ .../device-status-subscriptions | 168 ------------------ 2 files changed, 150 insertions(+), 168 deletions(-) create mode 100644 code/Test_definitions/device-roaming-status-subscriptions.feature delete mode 100644 code/Test_definitions/device-status-subscriptions diff --git a/code/Test_definitions/device-roaming-status-subscriptions.feature b/code/Test_definitions/device-roaming-status-subscriptions.feature new file mode 100644 index 00000000..f395e41a --- /dev/null +++ b/code/Test_definitions/device-roaming-status-subscriptions.feature @@ -0,0 +1,150 @@ + + @DeviceStatusRoamingSubscriptionSanity + Feature: CAMARA Device Roaming Status Subscriptions API, v0.6.0 - Operation DeviceStatus + + + # Input to be provided by the implementation to the tests + # References to OAS spec schemas refer to schemas specifies in device-roaming-status-subscriptions.yaml, version v0.6.0 + + Background: Common roaming status subscriptions setup + Given the resource "/device-roaming-status-subscriptions/v0/subscriptions" as BaseURL | + And the header "Content-Type" is set to "application/json" + And the header "x-correlator" is set to a UUID value + And the header "Authorization" is set to a valid access token + And the request body is set by default to a request body compliant with the schema + + + + @Device_Roaming_Status_Subscription_01_InRoamingEvent + Scenario: Check roaming event if the device roaming state changed to 'true' + Given use BaseURL + When create device status subscription for "$.msisdn1" and roaming-status event + Then response code is 201 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response property "$.status" is 201 + And the response property "$.code" is "CREATED" + Then get device status subscription + Then response code is 200 + When wait 10 seconds + Then the callback notification application receives roaming-status event + Then the roaming status is true + Then the country name is + | DG | + | GU | + | US | + Then the country code is 310 + When delete device status subscription + Then response code is 204 + + @Device_Roaming_Status_Subscription_02_NotInRoamingEvent + Scenario: Check roaming event if the device roaming state changed to 'false' + Given use BaseURL + When create device status subscription for "$.msisdn2" and roaming-status event + Then response code is 201 + Then get device status subscription + Then response code is 200 + When wait 10 seconds + Then the callback notification application receives roaming-status event + Then the roaming status is false + Then the country name is + | DG | + | GU | + | US | + Then the country code is 310 + When delete device status subscription + Then response code is 204 + + @Device_Roaming_Status_Subscription_03_CountryChangeEvent + Scenario: Check the country code event if the device in roaming changes a country + Given use BaseURL + When create device status subscription for "$.msisdn3" and change-country event + Then response code is 201 + Then get device status subscription + Then response code is 200 + When wait 10 seconds + Then the callback notification application receives change-country event + Then the country name is + | DE | + Then the country code is 262 + When delete device status subscription + Then response code is 204 + + @Device_Roaming_Status_Subscription_04_SubscriptionEndsEvent + Scenario: Check device status subscription ends event + Given use BaseURL + When create device status subscription for duration of 2 seconds + Then response code is 201 + Then get device status subscription + Then response code is 200 + When wait 10 seconds + Then the callback notification application receives subscription-ends event + Then get device status subscription + Then response code is 404 + + + @Device_Roaming_Status_Subscription_05_getSubscriptions + Scenario: get all device status event subscriptions + Given use BaseURL + When create device status subscription for a valid access token with client-id-1, "$.msisdn1" and change-country event + Then response code is 201 + When create device status subscription for a valid access token with client-id-1, "$.msisdn2" and roaming-status event + Then response code is 201 + When create device status subscription for a valid access token with client-id-2, "$.msisdn3" and connectivity-sms event + Then response code is 201 + When get all device status subscriptions for client-id-1 + Then response code is 200 + Then Number of subscriptions of client-id-1 is 2 + When get all device status subscriptions for client-id-2 + Then response code is 200 + Then Number of subscriptions of client-id-2 is 1 + Then delete subscriptions + + @Device_Roaming_Status_Subscription_06_getSubscriptionsForNotExistingSubscription + Scenario: get all device status subscriptions for a client that does not have any subscriptions + Given use BaseURL + When create device status subscription for a valid access token with client-id-1, "$.msisdn1" and connectivity-data event + Then response code is 201 + When get all device status subscriptions for client-id-2 + Then response code is 404 + Then Number of subscriptions of client-id-2 is 0 + Then delete subscriptions + And Respone code is 204 + + @Device_Roaming_Status_Subscription_07_getSubscriptionsForInvalidToken + Scenario: get all device status subscriptions for an invalid access token + Given use BaseURL + When create device status subscription for a valid access token with client-id-1, "$.msisdn2" and change-country event + Then response code is 201 + When get all device status subscriptions for an invalid access token + Then response code is 403 + Then delete subscriptions + And Respone code is 204 + + @Device_Roaming_Status_Subscription_08_DeviceIncorrectMsisdn + Scenario: Device status request for an incorrect msisdn + Given use BaseURL + When Request device status with incorrect msisdn in json payload + Then response code is 400 + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text + + @Device_Roaming_Status_Subscription_09_DeviceForPastSubscriptionExpirationTime + Scenario: Device status request for past subscriptionExpireTime + Given use BaseURL + When Request create device status subscription for subscriptionExpireTime in th past + Then response code is 400 + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text + + @Device_Roaming_Status_Subscription_10_DeviceWithNoMsisdn + Scenario: Device status request without MSISDN + Given use BaseURL + When Request create device status subscription without MSISDN + Then response code is 400 + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text + diff --git a/code/Test_definitions/device-status-subscriptions b/code/Test_definitions/device-status-subscriptions deleted file mode 100644 index 296d0733..00000000 --- a/code/Test_definitions/device-status-subscriptions +++ /dev/null @@ -1,168 +0,0 @@ -@DeviceStatusSubscriptionSanity -Feature: CAMARA DeviceStatus Subscription API, v0.5.1 - Operation DeviceStatus - - @DeviceStatusSubscription_01_InRoamingEvent - Scenario: Check roaming event if the device roaming state changed to 'true' - Given Use BaseURL - When Create device status subscription for MSISDN +491601111111 and roaming-status event - Then Response code is 201 - Then Get device status subscription - Then Response code is 200 - When Wait 10 seconds - Then The callback notification application receives roaming-status event - Then The roaming status is true - Then The country name is - | DG | - | GU | - | US | - Then The country code is 310 - When Delete device status subscription - Then Response code is 204 - - @DeviceStatusSubscription_02_NotInRoamingEvent - Scenario: Check roaming event if the device roaming state changed to 'false' - Given Use BaseURL - When Create device status subscription for MSISDN +49160333333 and roaming-status event - Then Response code is 201 - Then Get device status subscription - Then Response code is 200 - When Wait 10 seconds - Then The callback notification application receives roaming-status event - Then The roaming status is false - Then The country name is - | DG | - | GU | - | US | - Then The country code is 310 - When Delete device status subscription - Then Response code is 204 - - @DeviceStatusSubscription_03_CountryChangeEvent - Scenario: Check the country code event if the device in roaming changes a country - Given Use BaseURL - When Create device status subscription for MSISDN +49160222222 and change-country event - Then Response code is 201 - Then Get device status subscription - Then Response code is 200 - When Wait 10 seconds - Then The callback notification application receives change-country event - Then The country name is - | DE | - Then The country code is 262 - When Delete device status subscription - Then Response code is 204 - - @DeviceStatusSubscription_04_ConnectivityDataEvent - Scenario: Check connectivity event if the device connectivity is changed to Data usage - Given Use BaseURL - When Create device status subscription for MSISDN +491601111111 and connectivity-data event - Then Response code is 201 - Then Get device status subscription - Then Response code is 200 - When Wait 10 seconds - Then The callback notification application receives connectivity-data event - When Delete device status subscription - Then Response code is 204 - - @DeviceStatusSubscription_05_ConnectivitySmsEvent - Scenario: Check connectivity event if the device connectivity is changed to SMS usage - Given Use BaseURL - When Create device status subscription for MSISDN +491602222222 and connectivity-sms event - Then Response code is 201 - Then Get device status subscription - Then Response code is 200 - When Wait 10 seconds - Then The callback notification application receives connectivity-sms event - When Delete device status subscription - Then Response code is 204 - - @DeviceStatusSubscription_06_ConnectivityDisconnectedEvent - Scenario: Check connectivity event if the device connectivity is changed to disconnected - Given Use BaseURL - When Create device status subscription for MSISDN +491609999999 and connectivity-disconnected event - Then Response code is 201 - Then Get device status subscription - Then Response code is 200 - When Wait 10 seconds - Then The callback notification application receives connectivity-disconnected event - #When Delete device status subscription - #Then Response code is 204 - - @DeviceStatusSubscription_07_SubscriptionEndsEvent - Scenario: Check device status subscription ends event - Given Use BaseURL - When Create device status subscription for duration of 2 seconds - Then Response code is 201 - Then Get device status subscription - Then Response code is 200 - When Wait 10 seconds - Then The callback notification application receives subscription-ends event - Then Get device status subscription - Then Response code is 404 - - - @DeviceStatusSubscription_08_GetSubscriptions - Scenario: Get all device status event subscriptions - Given Use BaseURL - When Create device status subscription for a valid access token with client-id-1, MSISDN +49160222222 and change-country event - Then Response code is 201 - When Create device status subscription for a valid access token with client-id-1, MSISDN +49160333333 and roaming-status event - Then Response code is 201 - When Create device status subscription for a valid access token with client-id-2, MSISDN +491602222222 and connectivity-sms event - Then Response code is 201 - When Get all device status subscriptions for client-id-1 - Then Response code is 200 - Then Number of subscriptions of client-id-1 is 2 - When Get all device status subscriptions for client-id-2 - Then Response code is 200 - Then Number of subscriptions of client-id-2 is 1 - Then Delete subscriptions - - @DeviceStatusSubscription_09_GetSubscriptionsForNotExistingSubscription - Scenario: Get all device status subscriptions for a client that does not have any subscriptions - Given Use BaseURL - When Create device status subscription for a valid access token with client-id-1, MSISDN +491601111111 and connectivity-data event - Then Response code is 201 - When Get all device status subscriptions for client-id-2 - Then Response code is 200 - Then Number of subscriptions of client-id-2 is 0 - Then Delete subscriptions - - @DeviceStatusSubscription_10_GetSubscriptionsForInvalidToken - Scenario: Get all device status subscriptions for an invalid access token - Given Use BaseURL - When Create device status subscription for a valid access token with client-id-1, MSISDN +49160222222 and change-country event - Then Response code is 201 - When Get all device status subscriptions for an invalid access token - Then Response code is 403 - Then Delete subscriptions - - @DeviceStatusSubscription_11_DeviceIncorrectMsisdn - Scenario: Device status request for an incorrect msisdn - Given Use BaseURL - When Request device status with incorrect msisdn in json payload - Then Response code is 400 - - @DeviceStatusSubscription_12_DeviceForPastSubscriptionExpirationTime - Scenario: Device status request for past subscriptionExpireTime - Given Use BaseURL - When Request create device status subscription for subscriptionExpireTime in th past - Then Response code is 400 - - @DeviceStatusSubscription_13_DeviceWithNoMsisdn - Scenario: Device status request without MSISDN - Given Use BaseURL - When Request create device status subscription without MSISDN - Then Response code is 400 - - @DeviceStatusSubscription_14_GetSubscriptionsSMS - Scenario: Get all device status event subscriptions - Given Use BaseURL - When Create device status subscription for a valid access token with client-id-2, MSISDN +491609999999 and connectivity-sms event - Then Response code is 201 - - @DeviceStatusSubscription_15_GetSubscriptionsDisconnect - Scenario: Get all device status event subscriptions - Given Use BaseURL - When Create device status subscription for a valid access token with client-id-2, MSISDN +491603333333 and connectivity-disconnected event - Then Response code is 201 From 89f5de90d2006415f36c766c1042c225aa9fa247 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Tue, 23 Jul 2024 14:56:48 +0530 Subject: [PATCH 03/22] Create device-reachability-status-subscriptions.feature --- ...-reachability-status-subscriptions.feature | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 code/Test_definitions/device-reachability-status-subscriptions.feature diff --git a/code/Test_definitions/device-reachability-status-subscriptions.feature b/code/Test_definitions/device-reachability-status-subscriptions.feature new file mode 100644 index 00000000..0ccb5175 --- /dev/null +++ b/code/Test_definitions/device-reachability-status-subscriptions.feature @@ -0,0 +1,127 @@ + +@DeviceReachabilityStatusSubscriptionSanity + Feature: CAMARA Device Reachability Status Subscriptions API, v0.6.0 - Operations Device Status + + + # Input to be provided by the implementation to the tests + # References to OAS spec schemas refer to schemas specifies in device-reachability-status-subscriptions.yaml, version v0.6.0 + + Background: Common Device Reachability Status Subscriptions setup + Given the resource "/device-reachbility-status-subscriptions/v0/subscriptions" as BASEURL | + And the header "Content-Type" is set to "application/json" + And the header "Authorization" is set to a valid access token + And the header "x-correlator" is set to a UUID value + And the request body is set by default to a request body compliant with the schema + + @Device_Reachability_Status_Subscriptions_01_DataEvent + Scenario: Check reachability event if the device reachability is changed to Data usage + Given Use BaseURL + When Create device status subscription for "$msisdn1" and connectivity-data event + Then Response code is 201 + Then Get device status subscription + Then Response code is 200 + When Wait 10 seconds + Then The callback notification application receives connectivity-data event + When Delete device status subscription + Then Response code is 204 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "#/components/schemas/Subscription" + + @Device_Reachability_Status_Subscriptions_02_ConnectivitySmsEvent + Scenario: Check reachability event if the device reachability is changed to SMS usage + Given Use BaseURL + When Create device status subscription for MSISDN "$msisdn2" and connectivity-sms event + Then Response code is 201 + Then Get device status subscription + Then Response code is 200 + When Wait 10 seconds + Then The callback notification application receives connectivity-sms event + When Delete device status subscription + Then Response code is 204 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "#/components/schemas/Subscription" + + @Device_Reachability_Status_Subscriptions_03_ConnectivityDisconnectedEvent + Scenario: Check reachability event if the device reachability is changed to disconnected + Given Use BaseURL + When Create device status subscription for MSISDN "$msisdn3" and connectivity-disconnected event + Then Response code is 201 + Then Get device status subscription + Then Response code is 200 + When Wait 10 seconds + Then The callback notification application receives connectivity-disconnected event + When Delete device status subscription + Then Response code is 204 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "#/components/schemas/Subscription" + + + @Device_Reachability_Status_Subscriptions_04_Retrieve_Subscriptions_for_SMS + Scenario: Get all device status event subscriptions + Given Use BaseURL + When Create device status subscription for a valid access token with client-id-2,"$msisdn2" and connectivity-sms event + Then Response code is 201 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "#/components/schemas/Subscription" + + @Device_Reachability_Status_Subscriptions_05_SMS_DisconnectEvent + Scenario: Receive SMS disconnect event + Given Use BaseURL + When Create device status subscription for a valid access token with client-id-2, "$msisdn3" and connectivity-disconnected event + Then Response code is 201 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "#/components/schemas/Subscription" + + @Device_Reachability_Status_Subscriptions_06_GetSubscriptionsForNotExistingSubscription + Scenario: Get all device status subscriptions for a client that does not have any subscriptions + Given Use BaseURL + When Create device status subscription for a valid access token with client-id-1, "$msisdn1" and connectivity-data event + Then Response code is 201 + When Get all device status subscriptions for client-id-2 + Then Response code is 404 + Then Number of subscriptions of client-id-2 is 0 + Then Delete subscriptions + + @Device_Reachability_Status_Subscriptions_07_GetSubscriptionsForInvalidToken + Scenario: Get all device status subscriptions for an invalid access token + Given Use BaseURL + When Create device status subscription for a valid access token with client-id-1, "$msisdn2" and change-country event + Then Response code is 201 + When Get all device status subscriptions for an invalid access token + Then Response code is 401 + And the response property "$.status" is 401 + And the response property "$.code" is "UNAUTHENTICATED" + And the response property "$.message" contains a user friendly text + Then Delete subscriptions + + @Device_Reachability_Status_Subscriptions_08_DeviceIncorrectMsisdn + Scenario: Device status request for an incorrect msisdn + Given Use BaseURL + When Request device status with incorrect msisdn in json payload + Then Response code is 400 + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text + + @Device_Reachability_Status_Subscriptions_09_DeviceForPastSubscriptionExpirationTime + Scenario: Device status request for past subscriptionExpireTime + Given Use BaseURL + When Request create device status subscription for subscriptionExpireTime in th past + Then Response code is 400 + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text + + @Device_Reachability_Status_Subscriptions_10_DeviceWithNoMsisdn + Scenario: Device status request without MSISDN + Given Use BaseURL + When Request create device status subscription without MSISDN + Then Response code is 400 + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text From 810cd9d0a8e40c3e570dff91b66b0de88e431f45 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 00:11:38 +0530 Subject: [PATCH 04/22] Update device-reachability-status-subscriptions.feature --- ...-reachability-status-subscriptions.feature | 309 +++++++++++------- 1 file changed, 197 insertions(+), 112 deletions(-) diff --git a/code/Test_definitions/device-reachability-status-subscriptions.feature b/code/Test_definitions/device-reachability-status-subscriptions.feature index 0ccb5175..e1b6d90e 100644 --- a/code/Test_definitions/device-reachability-status-subscriptions.feature +++ b/code/Test_definitions/device-reachability-status-subscriptions.feature @@ -1,127 +1,212 @@ -@DeviceReachabilityStatusSubscriptionSanity - Feature: CAMARA Device Reachability Status Subscriptions API, v0.6.0 - Operations Device Status - - - # Input to be provided by the implementation to the tests - # References to OAS spec schemas refer to schemas specifies in device-reachability-status-subscriptions.yaml, version v0.6.0 - - Background: Common Device Reachability Status Subscriptions setup - Given the resource "/device-reachbility-status-subscriptions/v0/subscriptions" as BASEURL | - And the header "Content-Type" is set to "application/json" +@DeviceReachabilityStatusSubscription +Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations ReachabilityStatus + +# Input to be provided by the implementation to the tests +# References to OAS spec schemas refer to schemas specified in device-reachability-status-subscriptions.yaml, version v0.6.0 + + Background: Common Device Reachability Status setup + Given the resource "{apiroot}/device-reachability-status-subscriptions/v0.6" as base-url And the header "Authorization" is set to a valid access token And the header "x-correlator" is set to a UUID value - And the request body is set by default to a request body compliant with the schema - - @Device_Reachability_Status_Subscriptions_01_DataEvent - Scenario: Check reachability event if the device reachability is changed to Data usage - Given Use BaseURL - When Create device status subscription for "$msisdn1" and connectivity-data event - Then Response code is 201 - Then Get device status subscription - Then Response code is 200 - When Wait 10 seconds - Then The callback notification application receives connectivity-data event - When Delete device status subscription - Then Response code is 204 - And the response header "Content-Type" is "application/json" - And the response header "x-correlator" has same value as the request header "x-correlator" - And the response body complies with the OAS schema at "#/components/schemas/Subscription" - - @Device_Reachability_Status_Subscriptions_02_ConnectivitySmsEvent - Scenario: Check reachability event if the device reachability is changed to SMS usage - Given Use BaseURL - When Create device status subscription for MSISDN "$msisdn2" and connectivity-sms event - Then Response code is 201 - Then Get device status subscription - Then Response code is 200 - When Wait 10 seconds - Then The callback notification application receives connectivity-sms event - When Delete device status subscription - Then Response code is 204 - And the response header "Content-Type" is "application/json" + +######### Happy Path Scenarios ################################# + +@reachability_status_subscriptions_01_create_reachability_status_subscription_synchronously + Scenario: Create reachability status subscription synchronously + Given that subscriptions are created synchronously + And a valid subscription request body + When the request "createSubscription" is sent + Then the response code is 201 + And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" - And the response body complies with the OAS schema at "#/components/schemas/Subscription" - - @Device_Reachability_Status_Subscriptions_03_ConnectivityDisconnectedEvent - Scenario: Check reachability event if the device reachability is changed to disconnected - Given Use BaseURL - When Create device status subscription for MSISDN "$msisdn3" and connectivity-disconnected event - Then Response code is 201 - Then Get device status subscription - Then Response code is 200 - When Wait 10 seconds - Then The callback notification application receives connectivity-disconnected event - When Delete device status subscription - Then Response code is 204 - And the response header "Content-Type" is "application/json" + And the response body complies with the OAS schema at "/components/schemas/Subscription" + +@reachability_status_subscriptions_02_create_reachability_status_subscription_asynchronously + Scenario: Create reachability status subscription asynchronously + Given that subscriptions are created asynchronously + And a valid subscription request body + When the request "createSubscription" is sent + Then the response code is 202 + And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" - And the response body complies with the OAS schema at "#/components/schemas/Subscription" + And the response body complies with the OAS schema at "/components/schemas/SubscriptionAsync" - - @Device_Reachability_Status_Subscriptions_04_Retrieve_Subscriptions_for_SMS - Scenario: Get all device status event subscriptions - Given Use BaseURL - When Create device status subscription for a valid access token with client-id-2,"$msisdn2" and connectivity-sms event - Then Response code is 201 - And the response header "Content-Type" is "application/json" +@reachability_status_subscriptions_03_Operation_to_retrieve_list_of_subscriptions + Scenario: Get a list of subscriptions. + Given the request body is not available + When the request "retrieveSubscriptionList" is sent + Then the response code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And each item in the response body, if any, complies with the OAS schema at "/components/schemas/Subscription" + + @reachability_status_subscriptions_04_Operation_to_retrieve_subscription_based_on_an_existing_subscription-id + Scenario: Get a subscription based on existing subscription-id. + Given the request body is not available and path parameter "subscriptionId" is set to the identifier of an existing subscription + When the request "retrieveReachabilityStatusSubscription" is sent + Then the response code is 200 + And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" - And the response body complies with the OAS schema at "#/components/schemas/Subscription" - - @Device_Reachability_Status_Subscriptions_05_SMS_DisconnectEvent - Scenario: Receive SMS disconnect event - Given Use BaseURL - When Create device status subscription for a valid access token with client-id-2, "$msisdn3" and connectivity-disconnected event - Then Response code is 201 - And the response header "Content-Type" is "application/json" + And the response body complies with the OAS schema at "/components/schemas/Subscription" + + @reachability_status_subscriptions_05_Operation_to_delete_subscription_based_on_an_existing_subscription-id + Scenario: Delete a subscription based on existing subscription-id. + Given the request body is not available and path parameter "subscriptionId" is set to the identifier of an existing subscription + When the request "deleteReachabilityStatusSubscription" is sent + Then the response code is 202 or 204 And the response header "x-correlator" has same value as the request header "x-correlator" - And the response body complies with the OAS schema at "#/components/schemas/Subscription" - - @Device_Reachability_Status_Subscriptions_06_GetSubscriptionsForNotExistingSubscription - Scenario: Get all device status subscriptions for a client that does not have any subscriptions - Given Use BaseURL - When Create device status subscription for a valid access token with client-id-1, "$msisdn1" and connectivity-data event - Then Response code is 201 - When Get all device status subscriptions for client-id-2 - Then Response code is 404 - Then Number of subscriptions of client-id-2 is 0 - Then Delete subscriptions - - @Device_Reachability_Status_Subscriptions_07_GetSubscriptionsForInvalidToken - Scenario: Get all device status subscriptions for an invalid access token - Given Use BaseURL - When Create device status subscription for a valid access token with client-id-1, "$msisdn2" and change-country event - Then Response code is 201 - When Get all device status subscriptions for an invalid access token - Then Response code is 401 - And the response property "$.status" is 401 - And the response property "$.code" is "UNAUTHENTICATED" - And the response property "$.message" contains a user friendly text - Then Delete subscriptions - - @Device_Reachability_Status_Subscriptions_08_DeviceIncorrectMsisdn - Scenario: Device status request for an incorrect msisdn - Given Use BaseURL - When Request device status with incorrect msisdn in json payload - Then Response code is 400 - And the response property "$.status" is 400 + And if the response property $.status is 204 then response body is not available + And if the response property $.status is 202 then response body complies with the OAS schema at "/components/schemas/SubscriptionAsync" + +@reachability_status_subscriptions_06_Receive_notification_when_device_reachability_changed_to_data_usage + Scenario: Receive notification for reachability-data event + Given that subscriptions are created synchronously + And a valid subscription request body + And the request body property "$.type" is "reachability-data" + When the request "createSubscription" is sent + Then the response code is 201 + And if the device reachability is changed to data usage + Then event notification "reachability-data" is received on callback-url + And sink credentials are received as expected + And notification body complies with the OAS schema at "##/components/schemas/EventReachabilityData" + And type="org.camaraproject.device-reachability-status-subscriptions.v0.reachability-data" + +@reachability_status_subscriptions_07_Receive_notification_when_device_reachability_changed_to_sms_usage + Scenario: Receive notification for reachability-sms event + Given that subscriptions are created synchronously + And a valid subscription request body + And the request body property "$.type" is "reachability-sms" + When the request "createSubscription" is sent + Then the response code is 201 + And if the device reachability is changed to sms usage + Then event notification "reachability-sms" is received on callback-url + And sink credentials are received as expected + And notification body complies with the OAS schema at "##/components/schemas/EventReachabilitySms" + And type="org.camaraproject.device-reachability-status-subscriptions.v0.reachability-sms" + +@reachability_status_subscriptions_07_Receive_notification_when_device_reachability_changed_to_disconnected + Scenario: Receive notification for reachability-disconnected event + Given that subscriptions are created synchronously + And a valid subscription request body + And the request body property "$.type" is "reachability-disconnected" + When the request "createSubscription" is sent + Then the response code is 201 + And if the device reachability is changed to disconnected + Then event notification "reachability-disconnected" is received on callback-url + And sink credentials are received as expected + And notification body complies with the OAS schema at "##/components/schemas/EventReachabilityDisconnected" + And type="org.camaraproject.device-reachability-status-subscriptions.v0.reachability-disconnected" + +@reachability_status_subscriptions_10_subscriptionExpireTime + Scenario: Receive notification for subscription-ends event on expiry + Given that subscriptions are created synchronously + And a valid subscription request body + And the request body property "$.type" is "reachability-data" + And the request body property "$.subscriptionExpireTime" set to smaller value + When the request "createSubscription" is sent + Then the response code is 201 + Then the subscription is expired + Then event notification "subscription-ends" is received on callback-url + And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnds" + And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" + And the response property "$.terminationReason" is "SUBSCRIPTION_EXPIRED" + +@reachability_status_subscriptions_11_subscriptionMaxEvents + Scenario: Receive notification for subscription-ends event on max events reached + Given that subscriptions are created synchronously + And a valid subscription request body + And the request body property "$.type" is "reachability-data" + And the request body property "$.subscriptionMaxEvents" is set to 1 + When the request "createSubscription" is sent + Then the response code is 201 + Then event notification "subscription-ends" is received on callback-url + And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnds" + And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" + And the response property "$.terminationReason" is "MAX_EVENTS_REACHED" + + @reachability_status_subscriptions_12_subscription_delete_event_validation + Scenario: Receive notification for subscription-ends event on deletion + Given that subscriptions are created synchronously + And a valid subscription request body + When the request "createSubscription" is sent + Then the response code is 201 + When the request "deleteReachabilityStatusSubscription" is sent + Then the response code is 202 or 204 + Then event notification "subscription-ends" is received on callback-url + And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnds" + And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" + And the response property "$.terminationReason" is "SUBSCRIPTION_DELETED" + + +############### Error response scenarios ########################### + + @reachability_status_subscriptions_13_Create_reachability_status_subscription_for_a_device_with_invalid_parameter + Scenario: Create subscription with invalid parameter + Given a valid subscription request body with invalid parameter + When the request "createSubscription" is sent + Then the response code is 400 + And the response property "$.status" is 400 And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text - @Device_Reachability_Status_Subscriptions_09_DeviceForPastSubscriptionExpirationTime - Scenario: Device status request for past subscriptionExpireTime - Given Use BaseURL - When Request create device status subscription for subscriptionExpireTime in th past - Then Response code is 400 - And the response property "$.status" is 400 +@reachability_status_subscriptions_14_creation_of_subscription_with_expiry_time_in_past + Scenario: Expiry time in past + Given a valid subscription request body with expiry time in past + When the request "createSubscription" is sent + Then the response code is 400 + And the response property "$.status" is 400 And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text - @Device_Reachability_Status_Subscriptions_10_DeviceWithNoMsisdn - Scenario: Device status request without MSISDN - Given Use BaseURL - When Request create device status subscription without MSISDN - Then Response code is 400 - And the response property "$.status" is 400 - And the response property "$.code" is "INVALID_ARGUMENT" + @reachability_status_subscription_15_invalid_protocol + Scenario: subscription creation with invalid protocol + Given a valid subscription request body + And "$.protocol" is not "HTTP" + When the request "createSubscription" is sent + Then the response property "$.status" is 400 + And the response property "$.code" is "INVALID_PROTOCOL" + And the response property "$.message" contains a user friendly text + +@reachability_status_subscription_16_invalid_credential_type + Scenario: subscription creation with invalid credential type + Given a valid subscription request body + And "$.credentialType" is not "ACCESSTOKEN" + When the request "createSubscription" is sent + Then the response property "$.status" is 400 + And the response property "$.code" is "INVALID_CREDENTIAL" + And the response property "$.message" contains a user friendly text + +@reachability_status_subscription_17_invalid_access_token_type + Scenario: subscription creation with invalid access token type + Given a valid subscription request body + And "$.accessTokenType" is not "bearer" + When the request "createSubscription" is sent + Then the response property "$.status" is 400 + And the response property "$.code" is "INVALID_TOKEN" + And the response property "$.message" contains a user friendly text + +@reachability_status_subscription_18_invalid_credentials + Scenario: subscription creation with invalid credentials + Given a valid subscription request body with invalid credentials + When the request "createSubscription" is sent + Then the response property "$.status" is 401 + And the response property "$.code" is "UNAUTHENTICATED" + And the response property "$.message" contains a user friendly text + +@reachability_status_subscription_19_invalid_inconsistent_access_token + Scenario: subscription creation with inconsistent access token for requested events subscription + # To test this, a token have to be obtained for a different device + Given a valid subscription request body with inconsistent access token from different device + When the request "createSubscription" is sent + Then the response property "$.status" is 403 + And the response property "$.code" is "SUBSCRIPTION_MISMATCH" + And the response property "$.message" contains a user friendly text + +@reachability_status_subscription_20_invalid_resource_path + Scenario: subscription creation with invalid resource path + Given a valid subscription request body with invalid resource path + When the request "createSubscription" is sent + Then the response property "$.status" is 404 + And the response property "$.code" is "NOT_FOUND" And the response property "$.message" contains a user friendly text From 0ba1ca77ef671d35641045ffcc39acb16c5274a4 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 00:14:59 +0530 Subject: [PATCH 05/22] Update device-roaming-status-subscriptions.feature --- ...evice-roaming-status-subscriptions.feature | 354 +++++++++++------- 1 file changed, 215 insertions(+), 139 deletions(-) diff --git a/code/Test_definitions/device-roaming-status-subscriptions.feature b/code/Test_definitions/device-roaming-status-subscriptions.feature index f395e41a..87b5c0b7 100644 --- a/code/Test_definitions/device-roaming-status-subscriptions.feature +++ b/code/Test_definitions/device-roaming-status-subscriptions.feature @@ -1,150 +1,226 @@ - @DeviceStatusRoamingSubscriptionSanity - Feature: CAMARA Device Roaming Status Subscriptions API, v0.6.0 - Operation DeviceStatus - - - # Input to be provided by the implementation to the tests - # References to OAS spec schemas refer to schemas specifies in device-roaming-status-subscriptions.yaml, version v0.6.0 - - Background: Common roaming status subscriptions setup - Given the resource "/device-roaming-status-subscriptions/v0/subscriptions" as BaseURL | - And the header "Content-Type" is set to "application/json" - And the header "x-correlator" is set to a UUID value +@DeviceStatusRoamingSubscription +Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingStatus + +# Input to be provided by the implementation to the tests +# References to OAS spec schemas refer to schemas specified in device-roaming-status-subscriptions.yaml, version v0.6.0 + + Background: Common Device Roaming Status setup + Given the resource "{apiroot}/device-roaming-status-subscriptions/v0.6" as base-url And the header "Authorization" is set to a valid access token - And the request body is set by default to a request body compliant with the schema - + And the header "x-correlator" is set to a UUID value + +######### Happy Path Scenarios ################################# + +@roaming_status_subscriptions_01_create_roaming_status_subscription_synchronously + Scenario: Create roaming status subscription synchronously + Given that subscriptions are created synchronously + And a valid subscription request body + When the request "createSubscription" is sent + Then the response code is 201 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "/components/schemas/Subscription" + +@roaming_status_subscriptions_02_create_roaming_status_subscription_asynchronously + Scenario: Create roaming status subscription asynchronously + Given that subscriptions are created asynchronously + And a valid subscription request body + When the request "createSubscription" is sent + Then the response code is 202 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "/components/schemas/SubscriptionAsync" - - @Device_Roaming_Status_Subscription_01_InRoamingEvent - Scenario: Check roaming event if the device roaming state changed to 'true' - Given use BaseURL - When create device status subscription for "$.msisdn1" and roaming-status event - Then response code is 201 - And the response header "Content-Type" is "application/json" +@roaming_status_subscriptions_03_Operation_to_retrieve_list_of_subscriptions + Scenario: Get a list of subscriptions. + Given the request body is not available + When the request "retrieveSubscriptionList" is sent + Then the response code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And each item in the response body, if any, complies with the OAS schema at "/components/schemas/Subscription" + + @roaming_status_subscriptions_04_Operation_to_retrieve_subscription_based_on_an_existing_subscription-id + Scenario: Get a subscription based on existing subscription-id. + Given the request body is not available and path parameter "subscriptionId" is set to the identifier of an existing subscription + When the request "retrieveRoamingStatusSubscription" is sent + Then the response code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "/components/schemas/Subscription" + + @roaming_status_subscriptions_05_Operation_to_delete_subscription_based_on_an_existing_subscription-id + Scenario: Delete a subscription based on existing subscription-id. + Given the request body is not available and path parameter "subscriptionId" is set to the identifier of an existing subscription + When the request "deleteRoamingStatusSubscription" is sent + Then the response code is 202 or 204 And the response header "x-correlator" has same value as the request header "x-correlator" - And the response property "$.status" is 201 - And the response property "$.code" is "CREATED" - Then get device status subscription - Then response code is 200 - When wait 10 seconds - Then the callback notification application receives roaming-status event - Then the roaming status is true - Then the country name is - | DG | - | GU | - | US | - Then the country code is 310 - When delete device status subscription - Then response code is 204 - - @Device_Roaming_Status_Subscription_02_NotInRoamingEvent - Scenario: Check roaming event if the device roaming state changed to 'false' - Given use BaseURL - When create device status subscription for "$.msisdn2" and roaming-status event - Then response code is 201 - Then get device status subscription - Then response code is 200 - When wait 10 seconds - Then the callback notification application receives roaming-status event - Then the roaming status is false - Then the country name is - | DG | - | GU | - | US | - Then the country code is 310 - When delete device status subscription - Then response code is 204 - - @Device_Roaming_Status_Subscription_03_CountryChangeEvent - Scenario: Check the country code event if the device in roaming changes a country - Given use BaseURL - When create device status subscription for "$.msisdn3" and change-country event - Then response code is 201 - Then get device status subscription - Then response code is 200 - When wait 10 seconds - Then the callback notification application receives change-country event - Then the country name is - | DE | - Then the country code is 262 - When delete device status subscription - Then response code is 204 - - @Device_Roaming_Status_Subscription_04_SubscriptionEndsEvent - Scenario: Check device status subscription ends event - Given use BaseURL - When create device status subscription for duration of 2 seconds - Then response code is 201 - Then get device status subscription - Then response code is 200 - When wait 10 seconds - Then the callback notification application receives subscription-ends event - Then get device status subscription - Then response code is 404 - - - @Device_Roaming_Status_Subscription_05_getSubscriptions - Scenario: get all device status event subscriptions - Given use BaseURL - When create device status subscription for a valid access token with client-id-1, "$.msisdn1" and change-country event - Then response code is 201 - When create device status subscription for a valid access token with client-id-1, "$.msisdn2" and roaming-status event - Then response code is 201 - When create device status subscription for a valid access token with client-id-2, "$.msisdn3" and connectivity-sms event - Then response code is 201 - When get all device status subscriptions for client-id-1 - Then response code is 200 - Then Number of subscriptions of client-id-1 is 2 - When get all device status subscriptions for client-id-2 - Then response code is 200 - Then Number of subscriptions of client-id-2 is 1 - Then delete subscriptions - - @Device_Roaming_Status_Subscription_06_getSubscriptionsForNotExistingSubscription - Scenario: get all device status subscriptions for a client that does not have any subscriptions - Given use BaseURL - When create device status subscription for a valid access token with client-id-1, "$.msisdn1" and connectivity-data event - Then response code is 201 - When get all device status subscriptions for client-id-2 - Then response code is 404 - Then Number of subscriptions of client-id-2 is 0 - Then delete subscriptions - And Respone code is 204 - - @Device_Roaming_Status_Subscription_07_getSubscriptionsForInvalidToken - Scenario: get all device status subscriptions for an invalid access token - Given use BaseURL - When create device status subscription for a valid access token with client-id-1, "$.msisdn2" and change-country event - Then response code is 201 - When get all device status subscriptions for an invalid access token - Then response code is 403 - Then delete subscriptions - And Respone code is 204 - - @Device_Roaming_Status_Subscription_08_DeviceIncorrectMsisdn - Scenario: Device status request for an incorrect msisdn - Given use BaseURL - When Request device status with incorrect msisdn in json payload - Then response code is 400 - And the response property "$.status" is 400 + And if the response property $.status is 204 then response body is not available + And if the response property $.status is 202 then response body complies with the OAS schema at "/components/schemas/SubscriptionAsync" + +@roaming_status_subscriptions_06_Receive_notification_when_roaming_status_changed_to_on + Scenario: Receive notification for roaming-on event + Given that subscriptions are created synchronously + And a valid subscription request body + And the request body property "$.type" is "roaming-on" + When the request "createSubscription" is sent + Then the response code is 201 + And if the device switch from roaming "OFF" to roaming "ON" + Then event notification "roaming-on" is received on callback-url + And sink credentials are received as expected + And notification body complies with the OAS schema at "##/components/schemas/EventRoamingOn" + And type="org.camaraproject.roaming-status-subscriptions.v0.roaming-on" + +@roaming_status_subscriptions_07_Receive_notification_when_roaming_status_changed_to_off + Scenario: Receive notification for roaming-off event + Given that subscriptions are created synchronously + And a valid subscription request body + And the request body property "$.type" is "roaming-off" + When the request "createSubscription" is sent + Then the response code is 201 + And if the device switch from roaming "ON" to roaming "OFF" + Then event notification "roaming-off" is received on callback-url + And sink credentials are received as expected + And notification body complies with the OAS schema at "##/components/schemas/EventRoamingOff" + And type="org.camaraproject.roaming-status-subscriptions.v0.roaming-off" + +@roaming_status_subscriptions_08_Receive_notification_when_roaming_status_changed + Scenario: Receive notification for roaming-status changes + Given that subscriptions are created synchronously + And a valid subscription request body + And the request body property "$.type" is "roaming-status" + When the request "createSubscription" is sent + Then the response code is 201 + And if the device roaming-status changes + Then event notification "roaming-status" is received on callback-url + And sink credentials are received as expected + And notification body complies with the OAS schema at "##/components/schemas/EventRoamingStatus" + And type="org.camaraproject.roaming-status-subscriptions.v0.roaming-status" + + +@roaming_status_subscriptions_09_Receive_notification_when_roaming_change_country + Scenario: Receive notification for roaming-change-country + Given that subscriptions are created synchronously + And a valid subscription request body + And the request body property "$.type" is "roaming-change-country" + When the request "createSubscription" is sent + Then the response code is 201 + And if the device roaming country changes + Then event notification "roaming-change-country" is received on callback-url + And sink credentials are received as expected + And notification body complies with the OAS schema at "##/components/schemas/RoamingChangeCountry" + And type="org.camaraproject.roaming-status-subscriptions.v0.roaming-change-country" + +@roaming_status_subscriptions_10_subscriptionExpireTime + Scenario: Receive notification for subscription-ends event on expiry + Given that subscriptions are created synchronously + And a valid subscription request body + And the request body property "$.type" is "roaming-status" + And the request body property "$.subscriptionExpireTime" set to smaller value + When the request "createSubscription" is sent + Then the response code is 201 + And the subscription is expired + And event notification "subscription-ends" is received on callback-url + And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnds" + And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" + And the response property "$.terminationReason" is "SUBSCRIPTION_EXPIRED" + +@roaming_status_subscriptions_11_subscriptionMaxEvents + Scenario: Receive notification for subscription-ends event on max events reached + Given that subscriptions are created synchronously + And a valid subscription request body + And the request body property "$.type" is "roaming-status" + And the request body property "$.subscriptionMaxEvents" is set to 1 + When the request "createSubscription" is sent + Then the response code is 201 + Then event notification "subscription-ends" is received on callback-url + And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnds" + And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" + And the response property "$.terminationReason" is "MAX_EVENTS_REACHED" + + @roaming_status_subscriptions_12_subscription_delete_event_validation + Scenario: Receive notification for subscription-ends event on deletion + Given that subscriptions are created synchronously + And a valid subscription request body + When the request "createSubscription" is sent + Then the response code is 201 + When the request "deleteRoamingStatusSubscription" is sent + Then the response code is 202 or 204 + Then event notification "subscription-ends" is received on callback-url + And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnds" + And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" + And the response property "$.terminationReason" is "SUBSCRIPTION_DELETED" + + +############### Error response scenarios ########################### + + @roaming_status_subscriptions_13_Create_roaming_status_subscription_for_a_device_with_invalid_parameter + Scenario: Create subscription with invalid parameter + Given a valid subscription request body with invalid parameter + When the request "createSubscription" is sent + Then the response code is 400 + And the response property "$.status" is 400 And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text - @Device_Roaming_Status_Subscription_09_DeviceForPastSubscriptionExpirationTime - Scenario: Device status request for past subscriptionExpireTime - Given use BaseURL - When Request create device status subscription for subscriptionExpireTime in th past - Then response code is 400 - And the response property "$.status" is 400 +@roaming_status_subscriptions_14_creation_of_subscription_with_expiry_time_in_past + Scenario: Expiry time in past + Given a valid subscription request body with expiry time in past + When the request "createSubscription" is sent + Then the response code is 400 + And the response property "$.status" is 400 And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text - @Device_Roaming_Status_Subscription_10_DeviceWithNoMsisdn - Scenario: Device status request without MSISDN - Given use BaseURL - When Request create device status subscription without MSISDN - Then response code is 400 - And the response property "$.status" is 400 - And the response property "$.code" is "INVALID_ARGUMENT" + @roaming_status_subscription_15_invalid_protocol + Scenario: subscription creation with invalid protocol + Given a valid subscription request body + And "$.protocol" is not "HTTP" + When the request "createSubscription" is sent + Then the response property "$.status" is 400 + And the response property "$.code" is "INVALID_PROTOCOL" + And the response property "$.message" contains a user friendly text + +@roaming_status_subscription_16_invalid_credential_type + Scenario: subscription creation with invalid credential type + Given a valid subscription request body + And "$.credentialType" is not "ACCESSTOKEN" + When the request "createSubscription" is sent + Then the response property "$.status" is 400 + And the response property "$.code" is "INVALID_CREDENTIAL" + And the response property "$.message" contains a user friendly text + +@roaming_status_subscription_17_invalid_access_token_type + Scenario: subscription creation with invalid access token type + Given a valid subscription request body + And "$.accessTokenType" is not "bearer" + When the request "createSubscription" is sent + Then the response property "$.status" is 400 + And the response property "$.code" is "INVALID_TOKEN" + And the response property "$.message" contains a user friendly text + +@roaming_status_subscription_18_invalid_credentials + Scenario: subscription creation with invalid credentials + Given a valid subscription request body with invalid credentials + When the request "createSubscription" is sent + Then the response property "$.status" is 401 + And the response property "$.code" is "UNAUTHENTICATED" + And the response property "$.message" contains a user friendly text + +@roaming_status_subscription_19_invalid_inconsistent_access_token + Scenario: subscription creation with inconsistent access token for requested events subscription + # To test this, a token have to be obtained for a different device + Given a valid subscription request body with inconsistent access token from different device + When the request "createSubscription" is sent + Then the response property "$.status" is 403 + And the response property "$.code" is "SUBSCRIPTION_MISMATCH" + And the response property "$.message" contains a user friendly text + +@roaming_status_subscription_20_invalid_resource_path + Scenario: subscription creation with invalid resource path + Given a valid subscription request body with invalid resource path + When the request "createSubscription" is sent + Then the response property "$.status" is 404 + And the response property "$.code" is "NOT_FOUND" And the response property "$.message" contains a user friendly text - From c777bdf55795abc86ebcc5234e48022ae15b5f49 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 12:21:34 +0530 Subject: [PATCH 06/22] Update device-roaming-status-subscriptions.feature --- .../device-roaming-status-subscriptions.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/device-roaming-status-subscriptions.feature b/code/Test_definitions/device-roaming-status-subscriptions.feature index 87b5c0b7..d275767d 100644 --- a/code/Test_definitions/device-roaming-status-subscriptions.feature +++ b/code/Test_definitions/device-roaming-status-subscriptions.feature @@ -126,7 +126,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" And the response property "$.terminationReason" is "SUBSCRIPTION_EXPIRED" -@roaming_status_subscriptions_11_subscriptionMaxEvents +@roaming_status_subscriptions_11_subscription_ends_when_max_events_reached Scenario: Receive notification for subscription-ends event on max events reached Given that subscriptions are created synchronously And a valid subscription request body From b80604d8efd7c18ab7c00a070f90eaf79ec0308e Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 12:57:49 +0530 Subject: [PATCH 07/22] Update device-reachability-status-subscriptions.feature --- .../device-reachability-status-subscriptions.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/Test_definitions/device-reachability-status-subscriptions.feature b/code/Test_definitions/device-reachability-status-subscriptions.feature index e1b6d90e..a8642f7c 100644 --- a/code/Test_definitions/device-reachability-status-subscriptions.feature +++ b/code/Test_definitions/device-reachability-status-subscriptions.feature @@ -203,9 +203,9 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach And the response property "$.code" is "SUBSCRIPTION_MISMATCH" And the response property "$.message" contains a user friendly text -@reachability_status_subscription_20_invalid_resource_path - Scenario: subscription creation with invalid resource path - Given a valid subscription request body with invalid resource path +@reachability_status_subscription_20_unknown_subscription_id + Scenario: Get subscription when subscription-id is unknown to the system + Given the path parameter property "$.subscriptionId" is unknown to the system When the request "createSubscription" is sent Then the response property "$.status" is 404 And the response property "$.code" is "NOT_FOUND" From f761dfa2dfe19ec28feca4d5535427c97bbe48e4 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:09:43 +0530 Subject: [PATCH 08/22] Update device-reachability-status-subscriptions.feature --- ...ice-reachability-status-subscriptions.feature | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/code/Test_definitions/device-reachability-status-subscriptions.feature b/code/Test_definitions/device-reachability-status-subscriptions.feature index a8642f7c..a5500fc5 100644 --- a/code/Test_definitions/device-reachability-status-subscriptions.feature +++ b/code/Test_definitions/device-reachability-status-subscriptions.feature @@ -98,12 +98,12 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach And notification body complies with the OAS schema at "##/components/schemas/EventReachabilityDisconnected" And type="org.camaraproject.device-reachability-status-subscriptions.v0.reachability-disconnected" -@reachability_status_subscriptions_10_subscriptionExpireTime - Scenario: Receive notification for subscription-ends event on expiry +@reachability_status_subscriptions_10_subscription_Expiry +Scenario: Receive notification for subscription-ends event on expiry Given that subscriptions are created synchronously And a valid subscription request body And the request body property "$.type" is "reachability-data" - And the request body property "$.subscriptionExpireTime" set to smaller value + And the request body property "$.subscriptionExpireTime" is set to a value in the near future When the request "createSubscription" is sent Then the response code is 201 Then the subscription is expired @@ -112,7 +112,7 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" And the response property "$.terminationReason" is "SUBSCRIPTION_EXPIRED" -@reachability_status_subscriptions_11_subscriptionMaxEvents +@reachability_status_subscriptions_11_subscription_end_when_max_events Scenario: Receive notification for subscription-ends event on max events reached Given that subscriptions are created synchronously And a valid subscription request body @@ -143,7 +143,7 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach @reachability_status_subscriptions_13_Create_reachability_status_subscription_for_a_device_with_invalid_parameter Scenario: Create subscription with invalid parameter - Given a valid subscription request body with invalid parameter + Given the request body is not compliant with the schema "/components/schemas/SubscriptionRequest" When the request "createSubscription" is sent Then the response code is 400 And the response property "$.status" is 400 @@ -162,7 +162,7 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach @reachability_status_subscription_15_invalid_protocol Scenario: subscription creation with invalid protocol Given a valid subscription request body - And "$.protocol" is not "HTTP" + And the "$.protocol" is not "HTTP" When the request "createSubscription" is sent Then the response property "$.status" is 400 And the response property "$.code" is "INVALID_PROTOCOL" @@ -171,7 +171,7 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach @reachability_status_subscription_16_invalid_credential_type Scenario: subscription creation with invalid credential type Given a valid subscription request body - And "$.credentialType" is not "ACCESSTOKEN" + And the "$.credentialType" is not "ACCESSTOKEN" When the request "createSubscription" is sent Then the response property "$.status" is 400 And the response property "$.code" is "INVALID_CREDENTIAL" @@ -206,7 +206,7 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach @reachability_status_subscription_20_unknown_subscription_id Scenario: Get subscription when subscription-id is unknown to the system Given the path parameter property "$.subscriptionId" is unknown to the system - When the request "createSubscription" is sent + When the request "retrieveReachabilityStatusSubscription" is sent Then the response property "$.status" is 404 And the response property "$.code" is "NOT_FOUND" And the response property "$.message" contains a user friendly text From 1c7abc479f79bdd1902db82e54f3227e2e79e6dd Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:09:53 +0530 Subject: [PATCH 09/22] Update device-roaming-status-subscriptions.feature --- .../device-roaming-status-subscriptions.feature | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/Test_definitions/device-roaming-status-subscriptions.feature b/code/Test_definitions/device-roaming-status-subscriptions.feature index d275767d..5c229d6a 100644 --- a/code/Test_definitions/device-roaming-status-subscriptions.feature +++ b/code/Test_definitions/device-roaming-status-subscriptions.feature @@ -117,7 +117,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta Given that subscriptions are created synchronously And a valid subscription request body And the request body property "$.type" is "roaming-status" - And the request body property "$.subscriptionExpireTime" set to smaller value + And the request body property "$.subscriptionExpireTime" is set to a value in the near future When the request "createSubscription" is sent Then the response code is 201 And the subscription is expired @@ -157,7 +157,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta @roaming_status_subscriptions_13_Create_roaming_status_subscription_for_a_device_with_invalid_parameter Scenario: Create subscription with invalid parameter - Given a valid subscription request body with invalid parameter + Given the request body is not compliant with the schema "/components/schemas/SubscriptionRequest" When the request "createSubscription" is sent Then the response code is 400 And the response property "$.status" is 400 @@ -217,10 +217,10 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta And the response property "$.code" is "SUBSCRIPTION_MISMATCH" And the response property "$.message" contains a user friendly text -@roaming_status_subscription_20_invalid_resource_path - Scenario: subscription creation with invalid resource path - Given a valid subscription request body with invalid resource path - When the request "createSubscription" is sent +@roaming_status_subscription_20_unknown_subscription_id + Scenario: Get subscription when subscription-id is unknown to the system + Given the path parameter property "$.subscriptionId" is unknown to the system + When the request "retrieveRoamingStatusSubscription" is sent Then the response property "$.status" is 404 And the response property "$.code" is "NOT_FOUND" And the response property "$.message" contains a user friendly text From 8f16aabd728e52002d89fc90621b17b4330ca0e3 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:26:50 +0530 Subject: [PATCH 10/22] Update device-reachability-status-subscriptions.feature --- ...-reachability-status-subscriptions.feature | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/code/Test_definitions/device-reachability-status-subscriptions.feature b/code/Test_definitions/device-reachability-status-subscriptions.feature index a5500fc5..626eb6ec 100644 --- a/code/Test_definitions/device-reachability-status-subscriptions.feature +++ b/code/Test_definitions/device-reachability-status-subscriptions.feature @@ -85,7 +85,7 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach And notification body complies with the OAS schema at "##/components/schemas/EventReachabilitySms" And type="org.camaraproject.device-reachability-status-subscriptions.v0.reachability-sms" -@reachability_status_subscriptions_07_Receive_notification_when_device_reachability_changed_to_disconnected +@reachability_status_subscriptions_08_Receive_notification_when_device_reachability_changed_to_disconnected Scenario: Receive notification for reachability-disconnected event Given that subscriptions are created synchronously And a valid subscription request body @@ -98,7 +98,7 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach And notification body complies with the OAS schema at "##/components/schemas/EventReachabilityDisconnected" And type="org.camaraproject.device-reachability-status-subscriptions.v0.reachability-disconnected" -@reachability_status_subscriptions_10_subscription_Expiry +@reachability_status_subscriptions_09_subscription_Expiry Scenario: Receive notification for subscription-ends event on expiry Given that subscriptions are created synchronously And a valid subscription request body @@ -112,7 +112,7 @@ Scenario: Receive notification for subscription-ends event on expiry And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" And the response property "$.terminationReason" is "SUBSCRIPTION_EXPIRED" -@reachability_status_subscriptions_11_subscription_end_when_max_events +@reachability_status_subscriptions_10_subscription_end_when_max_events Scenario: Receive notification for subscription-ends event on max events reached Given that subscriptions are created synchronously And a valid subscription request body @@ -125,7 +125,7 @@ Scenario: Receive notification for subscription-ends event on expiry And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" And the response property "$.terminationReason" is "MAX_EVENTS_REACHED" - @reachability_status_subscriptions_12_subscription_delete_event_validation + @reachability_status_subscriptions_11_subscription_delete_event_validation Scenario: Receive notification for subscription-ends event on deletion Given that subscriptions are created synchronously And a valid subscription request body @@ -141,7 +141,7 @@ Scenario: Receive notification for subscription-ends event on expiry ############### Error response scenarios ########################### - @reachability_status_subscriptions_13_Create_reachability_status_subscription_for_a_device_with_invalid_parameter + @reachability_status_subscriptions_12_Create_reachability_status_subscription_for_a_device_with_invalid_parameter Scenario: Create subscription with invalid parameter Given the request body is not compliant with the schema "/components/schemas/SubscriptionRequest" When the request "createSubscription" is sent @@ -150,7 +150,7 @@ Scenario: Receive notification for subscription-ends event on expiry And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text -@reachability_status_subscriptions_14_creation_of_subscription_with_expiry_time_in_past +@reachability_status_subscriptions_13_creation_of_subscription_with_expiry_time_in_past Scenario: Expiry time in past Given a valid subscription request body with expiry time in past When the request "createSubscription" is sent @@ -159,7 +159,7 @@ Scenario: Receive notification for subscription-ends event on expiry And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text - @reachability_status_subscription_15_invalid_protocol + @reachability_status_subscription_14_invalid_protocol Scenario: subscription creation with invalid protocol Given a valid subscription request body And the "$.protocol" is not "HTTP" @@ -168,7 +168,7 @@ Scenario: Receive notification for subscription-ends event on expiry And the response property "$.code" is "INVALID_PROTOCOL" And the response property "$.message" contains a user friendly text -@reachability_status_subscription_16_invalid_credential_type +@reachability_status_subscription_15_invalid_credential_type Scenario: subscription creation with invalid credential type Given a valid subscription request body And the "$.credentialType" is not "ACCESSTOKEN" @@ -177,7 +177,7 @@ Scenario: Receive notification for subscription-ends event on expiry And the response property "$.code" is "INVALID_CREDENTIAL" And the response property "$.message" contains a user friendly text -@reachability_status_subscription_17_invalid_access_token_type +@reachability_status_subscription_16_invalid_access_token_type Scenario: subscription creation with invalid access token type Given a valid subscription request body And "$.accessTokenType" is not "bearer" @@ -186,7 +186,7 @@ Scenario: Receive notification for subscription-ends event on expiry And the response property "$.code" is "INVALID_TOKEN" And the response property "$.message" contains a user friendly text -@reachability_status_subscription_18_invalid_credentials +@reachability_status_subscription_17_invalid_credentials Scenario: subscription creation with invalid credentials Given a valid subscription request body with invalid credentials When the request "createSubscription" is sent @@ -194,7 +194,7 @@ Scenario: Receive notification for subscription-ends event on expiry And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text -@reachability_status_subscription_19_invalid_inconsistent_access_token +@reachability_status_subscription_18_invalid_inconsistent_access_token Scenario: subscription creation with inconsistent access token for requested events subscription # To test this, a token have to be obtained for a different device Given a valid subscription request body with inconsistent access token from different device @@ -203,7 +203,7 @@ Scenario: Receive notification for subscription-ends event on expiry And the response property "$.code" is "SUBSCRIPTION_MISMATCH" And the response property "$.message" contains a user friendly text -@reachability_status_subscription_20_unknown_subscription_id +@reachability_status_subscription_19_unknown_subscription_id Scenario: Get subscription when subscription-id is unknown to the system Given the path parameter property "$.subscriptionId" is unknown to the system When the request "retrieveReachabilityStatusSubscription" is sent From 0126c9b29a856ca63eafa9eb9c8e4d7ba039f686 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:47:29 +0530 Subject: [PATCH 11/22] Update device-reachability-status-subscriptions.feature --- .../device-reachability-status-subscriptions.feature | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/Test_definitions/device-reachability-status-subscriptions.feature b/code/Test_definitions/device-reachability-status-subscriptions.feature index 626eb6ec..0880f620 100644 --- a/code/Test_definitions/device-reachability-status-subscriptions.feature +++ b/code/Test_definitions/device-reachability-status-subscriptions.feature @@ -120,6 +120,7 @@ Scenario: Receive notification for subscription-ends event on expiry And the request body property "$.subscriptionMaxEvents" is set to 1 When the request "createSubscription" is sent Then the response code is 201 + Then event notification "reachability-data" is received on callback-url Then event notification "subscription-ends" is received on callback-url And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnds" And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" @@ -196,7 +197,7 @@ Scenario: Receive notification for subscription-ends event on expiry @reachability_status_subscription_18_invalid_inconsistent_access_token Scenario: subscription creation with inconsistent access token for requested events subscription - # To test this, a token have to be obtained for a different device + # To test this, a token have to be obtained for a different device Given a valid subscription request body with inconsistent access token from different device When the request "createSubscription" is sent Then the response property "$.status" is 403 From 392c4780493eb00731d4cc957d57f51de874bded Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:52:33 +0530 Subject: [PATCH 12/22] Update device-roaming-status-subscriptions.feature --- .../Test_definitions/device-roaming-status-subscriptions.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/code/Test_definitions/device-roaming-status-subscriptions.feature b/code/Test_definitions/device-roaming-status-subscriptions.feature index 5c229d6a..2184b7f1 100644 --- a/code/Test_definitions/device-roaming-status-subscriptions.feature +++ b/code/Test_definitions/device-roaming-status-subscriptions.feature @@ -134,6 +134,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta And the request body property "$.subscriptionMaxEvents" is set to 1 When the request "createSubscription" is sent Then the response code is 201 + Then event notification "roaming_on" is received on callback-url Then event notification "subscription-ends" is received on callback-url And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnds" And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" From 12e4561605ae41f68882e87d4dda294b863f9497 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 19:56:25 +0530 Subject: [PATCH 13/22] Update device-reachability-status-subscriptions.feature --- .../device-reachability-status-subscriptions.feature | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/code/Test_definitions/device-reachability-status-subscriptions.feature b/code/Test_definitions/device-reachability-status-subscriptions.feature index 0880f620..10a90ef1 100644 --- a/code/Test_definitions/device-reachability-status-subscriptions.feature +++ b/code/Test_definitions/device-reachability-status-subscriptions.feature @@ -43,7 +43,8 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach @reachability_status_subscriptions_04_Operation_to_retrieve_subscription_based_on_an_existing_subscription-id Scenario: Get a subscription based on existing subscription-id. - Given the request body is not available and path parameter "subscriptionId" is set to the identifier of an existing subscription + Given the request body is not available + And path parameter "subscriptionId" is set to the identifier of an existing subscription When the request "retrieveReachabilityStatusSubscription" is sent Then the response code is 200 And the response header "Content-Type" is "application/json" @@ -52,7 +53,8 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach @reachability_status_subscriptions_05_Operation_to_delete_subscription_based_on_an_existing_subscription-id Scenario: Delete a subscription based on existing subscription-id. - Given the request body is not available and path parameter "subscriptionId" is set to the identifier of an existing subscription + Given the request body is not available + And path parameter "subscriptionId" is set to the identifier of an existing subscription When the request "deleteReachabilityStatusSubscription" is sent Then the response code is 202 or 204 And the response header "x-correlator" has same value as the request header "x-correlator" @@ -163,7 +165,7 @@ Scenario: Receive notification for subscription-ends event on expiry @reachability_status_subscription_14_invalid_protocol Scenario: subscription creation with invalid protocol Given a valid subscription request body - And the "$.protocol" is not "HTTP" + And the request property "$.protocol" is not set to "HTTP" When the request "createSubscription" is sent Then the response property "$.status" is 400 And the response property "$.code" is "INVALID_PROTOCOL" @@ -172,7 +174,7 @@ Scenario: Receive notification for subscription-ends event on expiry @reachability_status_subscription_15_invalid_credential_type Scenario: subscription creation with invalid credential type Given a valid subscription request body - And the "$.credentialType" is not "ACCESSTOKEN" + And the request property "$.credentialType" is not "ACCESSTOKEN" When the request "createSubscription" is sent Then the response property "$.status" is 400 And the response property "$.code" is "INVALID_CREDENTIAL" @@ -181,7 +183,7 @@ Scenario: Receive notification for subscription-ends event on expiry @reachability_status_subscription_16_invalid_access_token_type Scenario: subscription creation with invalid access token type Given a valid subscription request body - And "$.accessTokenType" is not "bearer" + And the request property "$.accessTokenType" is not "bearer" When the request "createSubscription" is sent Then the response property "$.status" is 400 And the response property "$.code" is "INVALID_TOKEN" From 5e4b11cba7efe9e21893b71eaf895b241e8c41dd Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 19:58:30 +0530 Subject: [PATCH 14/22] Update device-roaming-status-subscriptions.feature --- .../device-roaming-status-subscriptions.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/Test_definitions/device-roaming-status-subscriptions.feature b/code/Test_definitions/device-roaming-status-subscriptions.feature index 2184b7f1..2f2bcfb5 100644 --- a/code/Test_definitions/device-roaming-status-subscriptions.feature +++ b/code/Test_definitions/device-roaming-status-subscriptions.feature @@ -177,7 +177,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta @roaming_status_subscription_15_invalid_protocol Scenario: subscription creation with invalid protocol Given a valid subscription request body - And "$.protocol" is not "HTTP" + And the request property "$.protocol" is not "HTTP" When the request "createSubscription" is sent Then the response property "$.status" is 400 And the response property "$.code" is "INVALID_PROTOCOL" @@ -186,7 +186,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta @roaming_status_subscription_16_invalid_credential_type Scenario: subscription creation with invalid credential type Given a valid subscription request body - And "$.credentialType" is not "ACCESSTOKEN" + And the request property "$.credentialType" is not "ACCESSTOKEN" When the request "createSubscription" is sent Then the response property "$.status" is 400 And the response property "$.code" is "INVALID_CREDENTIAL" @@ -195,7 +195,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta @roaming_status_subscription_17_invalid_access_token_type Scenario: subscription creation with invalid access token type Given a valid subscription request body - And "$.accessTokenType" is not "bearer" + And the request property "$.accessTokenType" is not "bearer" When the request "createSubscription" is sent Then the response property "$.status" is 400 And the response property "$.code" is "INVALID_TOKEN" From 13859534cb3c512eb78c93068d29e14add1a996b Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 21:24:04 +0530 Subject: [PATCH 15/22] Update device-reachability-status-subscriptions.feature --- ...-reachability-status-subscriptions.feature | 69 +++++++++++-------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/code/Test_definitions/device-reachability-status-subscriptions.feature b/code/Test_definitions/device-reachability-status-subscriptions.feature index 10a90ef1..d295f416 100644 --- a/code/Test_definitions/device-reachability-status-subscriptions.feature +++ b/code/Test_definitions/device-reachability-status-subscriptions.feature @@ -1,11 +1,11 @@ @DeviceReachabilityStatusSubscription -Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations ReachabilityStatus +Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reachability Status Subscription # Input to be provided by the implementation to the tests # References to OAS spec schemas refer to schemas specified in device-reachability-status-subscriptions.yaml, version v0.6.0 - Background: Common Device Reachability Status setup + Background: Common Device Reachability Status Subscriptions setup Given the resource "{apiroot}/device-reachability-status-subscriptions/v0.6" as base-url And the header "Authorization" is set to a valid access token And the header "x-correlator" is set to a UUID value @@ -32,36 +32,43 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach And the response header "x-correlator" has same value as the request header "x-correlator" And the response body complies with the OAS schema at "/components/schemas/SubscriptionAsync" -@reachability_status_subscriptions_03_Operation_to_retrieve_list_of_subscriptions - Scenario: Get a list of subscriptions. - Given the request body is not available +@reachability_status_subscriptions_03_Operation_to_retrieve_list_of_subscriptions_when_no_records + Scenario: Get a list of subscriptions when no subscriptions available + Given a client without subscriptions created When the request "retrieveSubscriptionList" is sent Then the response code is 200 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" - And each item in the response body, if any, complies with the OAS schema at "/components/schemas/Subscription" + And the response body is an empty array - @reachability_status_subscriptions_04_Operation_to_retrieve_subscription_based_on_an_existing_subscription-id +@reachability_status_subscriptions_04_Operation_to_retrieve_list_of_subscriptions + Scenario: Get a list of subscriptions + Given a client with subscriptions created + When the request "retrieveSubscriptionList" is sent + Then the response code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body has an array of items and each item complies with the OAS schema at "/components/schemas/Subscription" + + @reachability_status_subscriptions_05_Operation_to_retrieve_subscription_based_on_an_existing_subscription-id Scenario: Get a subscription based on existing subscription-id. - Given the request body is not available - And path parameter "subscriptionId" is set to the identifier of an existing subscription + Given the path parameter "subscriptionId" is set to the identifier of an existing subscription When the request "retrieveReachabilityStatusSubscription" is sent Then the response code is 200 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" And the response body complies with the OAS schema at "/components/schemas/Subscription" - @reachability_status_subscriptions_05_Operation_to_delete_subscription_based_on_an_existing_subscription-id + @reachability_status_subscriptions_06_Operation_to_delete_subscription_based_on_an_existing_subscription-id Scenario: Delete a subscription based on existing subscription-id. - Given the request body is not available - And path parameter "subscriptionId" is set to the identifier of an existing subscription + Given the path parameter "subscriptionId" is set to the identifier of an existing subscription When the request "deleteReachabilityStatusSubscription" is sent Then the response code is 202 or 204 And the response header "x-correlator" has same value as the request header "x-correlator" And if the response property $.status is 204 then response body is not available And if the response property $.status is 202 then response body complies with the OAS schema at "/components/schemas/SubscriptionAsync" -@reachability_status_subscriptions_06_Receive_notification_when_device_reachability_changed_to_data_usage +@reachability_status_subscriptions_07_Receive_notification_when_device_reachability_changed_to_data_usage Scenario: Receive notification for reachability-data event Given that subscriptions are created synchronously And a valid subscription request body @@ -74,7 +81,7 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach And notification body complies with the OAS schema at "##/components/schemas/EventReachabilityData" And type="org.camaraproject.device-reachability-status-subscriptions.v0.reachability-data" -@reachability_status_subscriptions_07_Receive_notification_when_device_reachability_changed_to_sms_usage +@reachability_status_subscriptions_08_Receive_notification_when_device_reachability_changed_to_sms_usage Scenario: Receive notification for reachability-sms event Given that subscriptions are created synchronously And a valid subscription request body @@ -87,7 +94,7 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach And notification body complies with the OAS schema at "##/components/schemas/EventReachabilitySms" And type="org.camaraproject.device-reachability-status-subscriptions.v0.reachability-sms" -@reachability_status_subscriptions_08_Receive_notification_when_device_reachability_changed_to_disconnected +@reachability_status_subscriptions_09_Receive_notification_when_device_reachability_changed_to_disconnected Scenario: Receive notification for reachability-disconnected event Given that subscriptions are created synchronously And a valid subscription request body @@ -100,11 +107,10 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach And notification body complies with the OAS schema at "##/components/schemas/EventReachabilityDisconnected" And type="org.camaraproject.device-reachability-status-subscriptions.v0.reachability-disconnected" -@reachability_status_subscriptions_09_subscription_Expiry +@reachability_status_subscriptions_10_subscription_expiry Scenario: Receive notification for subscription-ends event on expiry Given that subscriptions are created synchronously - And a valid subscription request body - And the request body property "$.type" is "reachability-data" + And a valid subscription request body And the request body property "$.subscriptionExpireTime" is set to a value in the near future When the request "createSubscription" is sent Then the response code is 201 @@ -114,7 +120,7 @@ Scenario: Receive notification for subscription-ends event on expiry And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" And the response property "$.terminationReason" is "SUBSCRIPTION_EXPIRED" -@reachability_status_subscriptions_10_subscription_end_when_max_events +@reachability_status_subscriptions_11_subscription_end_when_max_events Scenario: Receive notification for subscription-ends event on max events reached Given that subscriptions are created synchronously And a valid subscription request body @@ -128,7 +134,7 @@ Scenario: Receive notification for subscription-ends event on expiry And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" And the response property "$.terminationReason" is "MAX_EVENTS_REACHED" - @reachability_status_subscriptions_11_subscription_delete_event_validation + @reachability_status_subscriptions_12_subscription_delete_event_validation Scenario: Receive notification for subscription-ends event on deletion Given that subscriptions are created synchronously And a valid subscription request body @@ -144,7 +150,7 @@ Scenario: Receive notification for subscription-ends event on expiry ############### Error response scenarios ########################### - @reachability_status_subscriptions_12_Create_reachability_status_subscription_for_a_device_with_invalid_parameter + @reachability_status_subscriptions_13_Create_reachability_status_subscription_with_invalid_parameter Scenario: Create subscription with invalid parameter Given the request body is not compliant with the schema "/components/schemas/SubscriptionRequest" When the request "createSubscription" is sent @@ -153,7 +159,7 @@ Scenario: Receive notification for subscription-ends event on expiry And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text -@reachability_status_subscriptions_13_creation_of_subscription_with_expiry_time_in_past +@reachability_status_subscriptions_14_creation_of_subscription_with_expiry_time_in_past Scenario: Expiry time in past Given a valid subscription request body with expiry time in past When the request "createSubscription" is sent @@ -162,7 +168,7 @@ Scenario: Receive notification for subscription-ends event on expiry And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text - @reachability_status_subscription_14_invalid_protocol + @reachability_status_subscription_15_invalid_protocol Scenario: subscription creation with invalid protocol Given a valid subscription request body And the request property "$.protocol" is not set to "HTTP" @@ -171,7 +177,7 @@ Scenario: Receive notification for subscription-ends event on expiry And the response property "$.code" is "INVALID_PROTOCOL" And the response property "$.message" contains a user friendly text -@reachability_status_subscription_15_invalid_credential_type +@reachability_status_subscription_16_invalid_credential_type Scenario: subscription creation with invalid credential type Given a valid subscription request body And the request property "$.credentialType" is not "ACCESSTOKEN" @@ -180,7 +186,7 @@ Scenario: Receive notification for subscription-ends event on expiry And the response property "$.code" is "INVALID_CREDENTIAL" And the response property "$.message" contains a user friendly text -@reachability_status_subscription_16_invalid_access_token_type +@reachability_status_subscription_17_invalid_access_token_type Scenario: subscription creation with invalid access token type Given a valid subscription request body And the request property "$.accessTokenType" is not "bearer" @@ -189,24 +195,27 @@ Scenario: Receive notification for subscription-ends event on expiry And the response property "$.code" is "INVALID_TOKEN" And the response property "$.message" contains a user friendly text -@reachability_status_subscription_17_invalid_credentials +@reachability_status_subscription_18_invalid_credentials Scenario: subscription creation with invalid credentials - Given a valid subscription request body with invalid credentials + Given a valid subscription request body + And header "Authorization" token is set to invalid credentials When the request "createSubscription" is sent Then the response property "$.status" is 401 And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text -@reachability_status_subscription_18_invalid_inconsistent_access_token +@reachability_status_subscription_19_invalid_inconsistent_access_token Scenario: subscription creation with inconsistent access token for requested events subscription # To test this, a token have to be obtained for a different device - Given a valid subscription request body with inconsistent access token from different device + Given a valid subscription request body + And the request body property "$.device" is set to a valid testing device supported by the service + And header "Authorization" set to access token referring different device When the request "createSubscription" is sent Then the response property "$.status" is 403 And the response property "$.code" is "SUBSCRIPTION_MISMATCH" And the response property "$.message" contains a user friendly text -@reachability_status_subscription_19_unknown_subscription_id +@reachability_status_subscription_20_unknown_subscription_id Scenario: Get subscription when subscription-id is unknown to the system Given the path parameter property "$.subscriptionId" is unknown to the system When the request "retrieveReachabilityStatusSubscription" is sent From 2f37df72f259813773815fe87832bc18b89a3663 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 21:37:31 +0530 Subject: [PATCH 16/22] Update device-reachability-status-subscriptions.feature --- .../device-reachability-status-subscriptions.feature | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/Test_definitions/device-reachability-status-subscriptions.feature b/code/Test_definitions/device-reachability-status-subscriptions.feature index d295f416..8ae347ea 100644 --- a/code/Test_definitions/device-reachability-status-subscriptions.feature +++ b/code/Test_definitions/device-reachability-status-subscriptions.feature @@ -161,7 +161,8 @@ Scenario: Receive notification for subscription-ends event on expiry @reachability_status_subscriptions_14_creation_of_subscription_with_expiry_time_in_past Scenario: Expiry time in past - Given a valid subscription request body with expiry time in past + Given a valid subscription request body + And request body property "$.subscriptionexpiretime" in past When the request "createSubscription" is sent Then the response code is 400 And the response property "$.status" is 400 From fbc22a4e86f1d48f973a6d0725396c635d37648e Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 21:40:26 +0530 Subject: [PATCH 17/22] Update device-roaming-status-subscriptions.feature --- ...evice-roaming-status-subscriptions.feature | 69 +++++++++++-------- 1 file changed, 40 insertions(+), 29 deletions(-) diff --git a/code/Test_definitions/device-roaming-status-subscriptions.feature b/code/Test_definitions/device-roaming-status-subscriptions.feature index 2f2bcfb5..436e7749 100644 --- a/code/Test_definitions/device-roaming-status-subscriptions.feature +++ b/code/Test_definitions/device-roaming-status-subscriptions.feature @@ -32,34 +32,43 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta And the response header "x-correlator" has same value as the request header "x-correlator" And the response body complies with the OAS schema at "/components/schemas/SubscriptionAsync" -@roaming_status_subscriptions_03_Operation_to_retrieve_list_of_subscriptions +@roaming_status_subscriptions_03_Operation_to_retrieve_list_of_subscriptions_when_no_records + Scenario: Get a list of subscriptions when no subscriptions + Given a client without subscriptions created + When the request "retrieveSubscriptionList" is sent + Then the response code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body is an empty array + +@roaming_status_subscriptions_04_Operation_to_retrieve_list_of_subscriptions Scenario: Get a list of subscriptions. - Given the request body is not available + Given a client with subscriptions created When the request "retrieveSubscriptionList" is sent Then the response code is 200 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" - And each item in the response body, if any, complies with the OAS schema at "/components/schemas/Subscription" + And the response body has an array of items and each item complies with the OAS schema at "/components/schemas/Subscription" - @roaming_status_subscriptions_04_Operation_to_retrieve_subscription_based_on_an_existing_subscription-id + @roaming_status_subscriptions_05_Operation_to_retrieve_subscription_based_on_an_existing_subscription-id Scenario: Get a subscription based on existing subscription-id. - Given the request body is not available and path parameter "subscriptionId" is set to the identifier of an existing subscription + Given the path parameter "subscriptionId" is set to the identifier of an existing subscription When the request "retrieveRoamingStatusSubscription" is sent Then the response code is 200 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" And the response body complies with the OAS schema at "/components/schemas/Subscription" - @roaming_status_subscriptions_05_Operation_to_delete_subscription_based_on_an_existing_subscription-id + @roaming_status_subscriptions_06_Operation_to_delete_subscription_based_on_an_existing_subscription-id Scenario: Delete a subscription based on existing subscription-id. - Given the request body is not available and path parameter "subscriptionId" is set to the identifier of an existing subscription + Given the path parameter "subscriptionId" is set to the identifier of an existing subscription When the request "deleteRoamingStatusSubscription" is sent Then the response code is 202 or 204 And the response header "x-correlator" has same value as the request header "x-correlator" And if the response property $.status is 204 then response body is not available And if the response property $.status is 202 then response body complies with the OAS schema at "/components/schemas/SubscriptionAsync" -@roaming_status_subscriptions_06_Receive_notification_when_roaming_status_changed_to_on +@roaming_status_subscriptions_07_Receive_notification_when_roaming_status_changed_to_on Scenario: Receive notification for roaming-on event Given that subscriptions are created synchronously And a valid subscription request body @@ -72,7 +81,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta And notification body complies with the OAS schema at "##/components/schemas/EventRoamingOn" And type="org.camaraproject.roaming-status-subscriptions.v0.roaming-on" -@roaming_status_subscriptions_07_Receive_notification_when_roaming_status_changed_to_off +@roaming_status_subscriptions_08_Receive_notification_when_roaming_status_changed_to_off Scenario: Receive notification for roaming-off event Given that subscriptions are created synchronously And a valid subscription request body @@ -85,7 +94,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta And notification body complies with the OAS schema at "##/components/schemas/EventRoamingOff" And type="org.camaraproject.roaming-status-subscriptions.v0.roaming-off" -@roaming_status_subscriptions_08_Receive_notification_when_roaming_status_changed +@roaming_status_subscriptions_09_Receive_notification_when_roaming_status_changed Scenario: Receive notification for roaming-status changes Given that subscriptions are created synchronously And a valid subscription request body @@ -98,8 +107,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta And notification body complies with the OAS schema at "##/components/schemas/EventRoamingStatus" And type="org.camaraproject.roaming-status-subscriptions.v0.roaming-status" - -@roaming_status_subscriptions_09_Receive_notification_when_roaming_change_country +@roaming_status_subscriptions_10_Receive_notification_when_roaming_change_country Scenario: Receive notification for roaming-change-country Given that subscriptions are created synchronously And a valid subscription request body @@ -112,11 +120,10 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta And notification body complies with the OAS schema at "##/components/schemas/RoamingChangeCountry" And type="org.camaraproject.roaming-status-subscriptions.v0.roaming-change-country" -@roaming_status_subscriptions_10_subscriptionExpireTime +@roaming_status_subscriptions_11_subscription_expiry Scenario: Receive notification for subscription-ends event on expiry Given that subscriptions are created synchronously - And a valid subscription request body - And the request body property "$.type" is "roaming-status" + And a valid subscription request body And the request body property "$.subscriptionExpireTime" is set to a value in the near future When the request "createSubscription" is sent Then the response code is 201 @@ -126,11 +133,11 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" And the response property "$.terminationReason" is "SUBSCRIPTION_EXPIRED" -@roaming_status_subscriptions_11_subscription_ends_when_max_events_reached +@roaming_status_subscriptions_12_subscription_ends_when_max_events_reached Scenario: Receive notification for subscription-ends event on max events reached Given that subscriptions are created synchronously And a valid subscription request body - And the request body property "$.type" is "roaming-status" + And the request body property "$.type" is "roaming_on" And the request body property "$.subscriptionMaxEvents" is set to 1 When the request "createSubscription" is sent Then the response code is 201 @@ -140,7 +147,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" And the response property "$.terminationReason" is "MAX_EVENTS_REACHED" - @roaming_status_subscriptions_12_subscription_delete_event_validation + @roaming_status_subscriptions_13_subscription_delete_event_validation Scenario: Receive notification for subscription-ends event on deletion Given that subscriptions are created synchronously And a valid subscription request body @@ -156,7 +163,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta ############### Error response scenarios ########################### - @roaming_status_subscriptions_13_Create_roaming_status_subscription_for_a_device_with_invalid_parameter + @roaming_status_subscriptions_14_Create_roaming_status_subscription_with_invalid_parameter Scenario: Create subscription with invalid parameter Given the request body is not compliant with the schema "/components/schemas/SubscriptionRequest" When the request "createSubscription" is sent @@ -165,16 +172,17 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text -@roaming_status_subscriptions_14_creation_of_subscription_with_expiry_time_in_past +@roaming_status_subscriptions_15_creation_of_subscription_with_expiry_time_in_past Scenario: Expiry time in past - Given a valid subscription request body with expiry time in past + Given a valid subscription request body + And request body property "$.subscriptionExpireTime" in past When the request "createSubscription" is sent Then the response code is 400 And the response property "$.status" is 400 And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text - @roaming_status_subscription_15_invalid_protocol + @roaming_status_subscription_16_invalid_protocol Scenario: subscription creation with invalid protocol Given a valid subscription request body And the request property "$.protocol" is not "HTTP" @@ -183,7 +191,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta And the response property "$.code" is "INVALID_PROTOCOL" And the response property "$.message" contains a user friendly text -@roaming_status_subscription_16_invalid_credential_type +@roaming_status_subscription_17_invalid_credential_type Scenario: subscription creation with invalid credential type Given a valid subscription request body And the request property "$.credentialType" is not "ACCESSTOKEN" @@ -192,7 +200,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta And the response property "$.code" is "INVALID_CREDENTIAL" And the response property "$.message" contains a user friendly text -@roaming_status_subscription_17_invalid_access_token_type +@roaming_status_subscription_18_invalid_access_token_type Scenario: subscription creation with invalid access token type Given a valid subscription request body And the request property "$.accessTokenType" is not "bearer" @@ -201,24 +209,27 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta And the response property "$.code" is "INVALID_TOKEN" And the response property "$.message" contains a user friendly text -@roaming_status_subscription_18_invalid_credentials +@roaming_status_subscription_19_invalid_credentials Scenario: subscription creation with invalid credentials - Given a valid subscription request body with invalid credentials + Given a valid subscription request body + And header "Authorization" token is set to invalid credentials When the request "createSubscription" is sent Then the response property "$.status" is 401 And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text -@roaming_status_subscription_19_invalid_inconsistent_access_token +@roaming_status_subscription_20_invalid_inconsistent_access_token Scenario: subscription creation with inconsistent access token for requested events subscription # To test this, a token have to be obtained for a different device - Given a valid subscription request body with inconsistent access token from different device + Given a valid subscription request body + And the request body property "$.device" is set to a valid testing device supported by the service + And header "Authorization" set to access token referring different device When the request "createSubscription" is sent Then the response property "$.status" is 403 And the response property "$.code" is "SUBSCRIPTION_MISMATCH" And the response property "$.message" contains a user friendly text -@roaming_status_subscription_20_unknown_subscription_id +@roaming_status_subscription_21_unknown_subscription_id Scenario: Get subscription when subscription-id is unknown to the system Given the path parameter property "$.subscriptionId" is unknown to the system When the request "retrieveRoamingStatusSubscription" is sent From 5f62bd75d69fb88587dbaf9bb48e7057af40e2ba Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:39:50 +0530 Subject: [PATCH 18/22] Update device-reachability-status-subscriptions.feature --- .../device-reachability-status-subscriptions.feature | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/Test_definitions/device-reachability-status-subscriptions.feature b/code/Test_definitions/device-reachability-status-subscriptions.feature index 8ae347ea..2b74b547 100644 --- a/code/Test_definitions/device-reachability-status-subscriptions.feature +++ b/code/Test_definitions/device-reachability-status-subscriptions.feature @@ -117,7 +117,7 @@ Scenario: Receive notification for subscription-ends event on expiry Then the subscription is expired Then event notification "subscription-ends" is received on callback-url And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnds" - And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" + And type="org.camaraproject.device-reachability-status-subscriptions.v0.subscription-ends" And the response property "$.terminationReason" is "SUBSCRIPTION_EXPIRED" @reachability_status_subscriptions_11_subscription_end_when_max_events @@ -131,7 +131,7 @@ Scenario: Receive notification for subscription-ends event on expiry Then event notification "reachability-data" is received on callback-url Then event notification "subscription-ends" is received on callback-url And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnds" - And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" + And type="org.camaraproject.device-reachability-status-subscriptions.v0.subscription-ends" And the response property "$.terminationReason" is "MAX_EVENTS_REACHED" @reachability_status_subscriptions_12_subscription_delete_event_validation @@ -144,7 +144,7 @@ Scenario: Receive notification for subscription-ends event on expiry Then the response code is 202 or 204 Then event notification "subscription-ends" is received on callback-url And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnds" - And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" + And type="org.camaraproject.device-reachability-status-subscriptions.v0.subscription-ends" And the response property "$.terminationReason" is "SUBSCRIPTION_DELETED" @@ -193,7 +193,7 @@ Scenario: Receive notification for subscription-ends event on expiry And the request property "$.accessTokenType" is not "bearer" When the request "createSubscription" is sent Then the response property "$.status" is 400 - And the response property "$.code" is "INVALID_TOKEN" + And the response property "$.code" is "INVALID_TOKEN" or "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text @reachability_status_subscription_18_invalid_credentials From 54b0614e8c20971c775a086614c4f12e7f606f37 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:41:57 +0530 Subject: [PATCH 19/22] Update device-roaming-status-subscriptions.feature --- .../device-roaming-status-subscriptions.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/Test_definitions/device-roaming-status-subscriptions.feature b/code/Test_definitions/device-roaming-status-subscriptions.feature index 436e7749..069f7776 100644 --- a/code/Test_definitions/device-roaming-status-subscriptions.feature +++ b/code/Test_definitions/device-roaming-status-subscriptions.feature @@ -130,7 +130,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta And the subscription is expired And event notification "subscription-ends" is received on callback-url And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnds" - And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" + And type="org.camaraproject.roaming-status-subscriptions.v0.subscription-ends" And the response property "$.terminationReason" is "SUBSCRIPTION_EXPIRED" @roaming_status_subscriptions_12_subscription_ends_when_max_events_reached @@ -144,7 +144,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta Then event notification "roaming_on" is received on callback-url Then event notification "subscription-ends" is received on callback-url And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnds" - And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" + And type="org.camaraproject.roaming-status-subscriptions.v0.subscription-ends" And the response property "$.terminationReason" is "MAX_EVENTS_REACHED" @roaming_status_subscriptions_13_subscription_delete_event_validation @@ -157,7 +157,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta Then the response code is 202 or 204 Then event notification "subscription-ends" is received on callback-url And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnds" - And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" + And type="org.camaraproject.roaming-status-subscriptions.v0.subscription-ends" And the response property "$.terminationReason" is "SUBSCRIPTION_DELETED" From bf37c42b1b87e63150f9166a794fb169a2a8f6a4 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:43:38 +0530 Subject: [PATCH 20/22] Update device-roaming-status-subscriptions.feature --- .../device-roaming-status-subscriptions.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/device-roaming-status-subscriptions.feature b/code/Test_definitions/device-roaming-status-subscriptions.feature index 069f7776..305b10ed 100644 --- a/code/Test_definitions/device-roaming-status-subscriptions.feature +++ b/code/Test_definitions/device-roaming-status-subscriptions.feature @@ -206,7 +206,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta And the request property "$.accessTokenType" is not "bearer" When the request "createSubscription" is sent Then the response property "$.status" is 400 - And the response property "$.code" is "INVALID_TOKEN" + And the response property "$.code" is "INVALID_TOKEN" or "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text @roaming_status_subscription_19_invalid_credentials From b48638e93a741d6b9544dd464f257412b22dbd82 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:53:41 +0530 Subject: [PATCH 21/22] Update device-reachability-status-subscriptions.feature --- ...-reachability-status-subscriptions.feature | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/code/Test_definitions/device-reachability-status-subscriptions.feature b/code/Test_definitions/device-reachability-status-subscriptions.feature index 2b74b547..f27ee48d 100644 --- a/code/Test_definitions/device-reachability-status-subscriptions.feature +++ b/code/Test_definitions/device-reachability-status-subscriptions.feature @@ -16,7 +16,7 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach Scenario: Create reachability status subscription synchronously Given that subscriptions are created synchronously And a valid subscription request body - When the request "createSubscription" is sent + When the request "createDeviceReachabilityStatusSubscription" is sent Then the response code is 201 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" @@ -26,7 +26,7 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach Scenario: Create reachability status subscription asynchronously Given that subscriptions are created asynchronously And a valid subscription request body - When the request "createSubscription" is sent + When the request "createDeviceReachabilityStatusSubscription" is sent Then the response code is 202 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" @@ -53,7 +53,7 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach @reachability_status_subscriptions_05_Operation_to_retrieve_subscription_based_on_an_existing_subscription-id Scenario: Get a subscription based on existing subscription-id. Given the path parameter "subscriptionId" is set to the identifier of an existing subscription - When the request "retrieveReachabilityStatusSubscription" is sent + When the request "retrieveSubscription" is sent Then the response code is 200 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" @@ -62,7 +62,7 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach @reachability_status_subscriptions_06_Operation_to_delete_subscription_based_on_an_existing_subscription-id Scenario: Delete a subscription based on existing subscription-id. Given the path parameter "subscriptionId" is set to the identifier of an existing subscription - When the request "deleteReachabilityStatusSubscription" is sent + When the request "deleteSubscription" is sent Then the response code is 202 or 204 And the response header "x-correlator" has same value as the request header "x-correlator" And if the response property $.status is 204 then response body is not available @@ -73,7 +73,7 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach Given that subscriptions are created synchronously And a valid subscription request body And the request body property "$.type" is "reachability-data" - When the request "createSubscription" is sent + When the request "createDeviceReachabilityStatusSubscription" is sent Then the response code is 201 And if the device reachability is changed to data usage Then event notification "reachability-data" is received on callback-url @@ -86,7 +86,7 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach Given that subscriptions are created synchronously And a valid subscription request body And the request body property "$.type" is "reachability-sms" - When the request "createSubscription" is sent + When the request "createDeviceReachabilityStatusSubscription" is sent Then the response code is 201 And if the device reachability is changed to sms usage Then event notification "reachability-sms" is received on callback-url @@ -99,7 +99,7 @@ Feature: Device Reachability Status Subscriptions API, v0.6.0 - Operations Reach Given that subscriptions are created synchronously And a valid subscription request body And the request body property "$.type" is "reachability-disconnected" - When the request "createSubscription" is sent + When the request "createDeviceReachabilityStatusSubscription" is sent Then the response code is 201 And if the device reachability is changed to disconnected Then event notification "reachability-disconnected" is received on callback-url @@ -112,7 +112,7 @@ Scenario: Receive notification for subscription-ends event on expiry Given that subscriptions are created synchronously And a valid subscription request body And the request body property "$.subscriptionExpireTime" is set to a value in the near future - When the request "createSubscription" is sent + When the request "createDeviceReachabilityStatusSubscription" is sent Then the response code is 201 Then the subscription is expired Then event notification "subscription-ends" is received on callback-url @@ -126,7 +126,7 @@ Scenario: Receive notification for subscription-ends event on expiry And a valid subscription request body And the request body property "$.type" is "reachability-data" And the request body property "$.subscriptionMaxEvents" is set to 1 - When the request "createSubscription" is sent + When the request "createDeviceReachabilityStatusSubscription" is sent Then the response code is 201 Then event notification "reachability-data" is received on callback-url Then event notification "subscription-ends" is received on callback-url @@ -138,9 +138,9 @@ Scenario: Receive notification for subscription-ends event on expiry Scenario: Receive notification for subscription-ends event on deletion Given that subscriptions are created synchronously And a valid subscription request body - When the request "createSubscription" is sent + When the request "createDeviceReachabilityStatusSubscription" is sent Then the response code is 201 - When the request "deleteReachabilityStatusSubscription" is sent + When the request "deleteSubscription" is sent Then the response code is 202 or 204 Then event notification "subscription-ends" is received on callback-url And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnds" @@ -153,7 +153,7 @@ Scenario: Receive notification for subscription-ends event on expiry @reachability_status_subscriptions_13_Create_reachability_status_subscription_with_invalid_parameter Scenario: Create subscription with invalid parameter Given the request body is not compliant with the schema "/components/schemas/SubscriptionRequest" - When the request "createSubscription" is sent + When the request "createDeviceReachabilityStatusSubscription" is sent Then the response code is 400 And the response property "$.status" is 400 And the response property "$.code" is "INVALID_ARGUMENT" @@ -163,7 +163,7 @@ Scenario: Receive notification for subscription-ends event on expiry Scenario: Expiry time in past Given a valid subscription request body And request body property "$.subscriptionexpiretime" in past - When the request "createSubscription" is sent + When the request "createDeviceReachabilityStatusSubscription" is sent Then the response code is 400 And the response property "$.status" is 400 And the response property "$.code" is "INVALID_ARGUMENT" @@ -173,7 +173,7 @@ Scenario: Receive notification for subscription-ends event on expiry Scenario: subscription creation with invalid protocol Given a valid subscription request body And the request property "$.protocol" is not set to "HTTP" - When the request "createSubscription" is sent + When the request "createDeviceReachabilityStatusSubscription" is sent Then the response property "$.status" is 400 And the response property "$.code" is "INVALID_PROTOCOL" And the response property "$.message" contains a user friendly text @@ -182,7 +182,7 @@ Scenario: Receive notification for subscription-ends event on expiry Scenario: subscription creation with invalid credential type Given a valid subscription request body And the request property "$.credentialType" is not "ACCESSTOKEN" - When the request "createSubscription" is sent + When the request "createDeviceReachabilityStatusSubscription" is sent Then the response property "$.status" is 400 And the response property "$.code" is "INVALID_CREDENTIAL" And the response property "$.message" contains a user friendly text @@ -191,7 +191,7 @@ Scenario: Receive notification for subscription-ends event on expiry Scenario: subscription creation with invalid access token type Given a valid subscription request body And the request property "$.accessTokenType" is not "bearer" - When the request "createSubscription" is sent + When the request "createDeviceReachabilityStatusSubscription" is sent Then the response property "$.status" is 400 And the response property "$.code" is "INVALID_TOKEN" or "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text @@ -200,7 +200,7 @@ Scenario: Receive notification for subscription-ends event on expiry Scenario: subscription creation with invalid credentials Given a valid subscription request body And header "Authorization" token is set to invalid credentials - When the request "createSubscription" is sent + When the request "createDeviceReachabilityStatusSubscription" is sent Then the response property "$.status" is 401 And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text @@ -211,7 +211,7 @@ Scenario: Receive notification for subscription-ends event on expiry Given a valid subscription request body And the request body property "$.device" is set to a valid testing device supported by the service And header "Authorization" set to access token referring different device - When the request "createSubscription" is sent + When the request "createDeviceReachabilityStatusSubscription" is sent Then the response property "$.status" is 403 And the response property "$.code" is "SUBSCRIPTION_MISMATCH" And the response property "$.message" contains a user friendly text @@ -219,7 +219,7 @@ Scenario: Receive notification for subscription-ends event on expiry @reachability_status_subscription_20_unknown_subscription_id Scenario: Get subscription when subscription-id is unknown to the system Given the path parameter property "$.subscriptionId" is unknown to the system - When the request "retrieveReachabilityStatusSubscription" is sent + When the request "retrieveSubscription" is sent Then the response property "$.status" is 404 And the response property "$.code" is "NOT_FOUND" And the response property "$.message" contains a user friendly text From e18cc4e1eb9bea264244428b4e93db9bf1ff4353 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:57:17 +0530 Subject: [PATCH 22/22] Update device-roaming-status-subscriptions.feature --- ...evice-roaming-status-subscriptions.feature | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/code/Test_definitions/device-roaming-status-subscriptions.feature b/code/Test_definitions/device-roaming-status-subscriptions.feature index 305b10ed..c3c7f882 100644 --- a/code/Test_definitions/device-roaming-status-subscriptions.feature +++ b/code/Test_definitions/device-roaming-status-subscriptions.feature @@ -16,7 +16,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta Scenario: Create roaming status subscription synchronously Given that subscriptions are created synchronously And a valid subscription request body - When the request "createSubscription" is sent + When the request "createDeviceRoamingStatusSubscription" is sent Then the response code is 201 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" @@ -26,7 +26,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta Scenario: Create roaming status subscription asynchronously Given that subscriptions are created asynchronously And a valid subscription request body - When the request "createSubscription" is sent + When the request "createDeviceRoamingStatusSubscription" is sent Then the response code is 202 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" @@ -53,7 +53,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta @roaming_status_subscriptions_05_Operation_to_retrieve_subscription_based_on_an_existing_subscription-id Scenario: Get a subscription based on existing subscription-id. Given the path parameter "subscriptionId" is set to the identifier of an existing subscription - When the request "retrieveRoamingStatusSubscription" is sent + When the request "retrieveSubscription" is sent Then the response code is 200 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" @@ -62,7 +62,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta @roaming_status_subscriptions_06_Operation_to_delete_subscription_based_on_an_existing_subscription-id Scenario: Delete a subscription based on existing subscription-id. Given the path parameter "subscriptionId" is set to the identifier of an existing subscription - When the request "deleteRoamingStatusSubscription" is sent + When the request "deleteSubscription" is sent Then the response code is 202 or 204 And the response header "x-correlator" has same value as the request header "x-correlator" And if the response property $.status is 204 then response body is not available @@ -73,7 +73,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta Given that subscriptions are created synchronously And a valid subscription request body And the request body property "$.type" is "roaming-on" - When the request "createSubscription" is sent + When the request "createDeviceRoamingStatusSubscription" is sent Then the response code is 201 And if the device switch from roaming "OFF" to roaming "ON" Then event notification "roaming-on" is received on callback-url @@ -86,7 +86,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta Given that subscriptions are created synchronously And a valid subscription request body And the request body property "$.type" is "roaming-off" - When the request "createSubscription" is sent + When the request "createDeviceRoamingStatusSubscription" is sent Then the response code is 201 And if the device switch from roaming "ON" to roaming "OFF" Then event notification "roaming-off" is received on callback-url @@ -99,7 +99,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta Given that subscriptions are created synchronously And a valid subscription request body And the request body property "$.type" is "roaming-status" - When the request "createSubscription" is sent + When the request "createDeviceRoamingStatusSubscription" is sent Then the response code is 201 And if the device roaming-status changes Then event notification "roaming-status" is received on callback-url @@ -112,7 +112,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta Given that subscriptions are created synchronously And a valid subscription request body And the request body property "$.type" is "roaming-change-country" - When the request "createSubscription" is sent + When the request "createDeviceRoamingStatusSubscription" is sent Then the response code is 201 And if the device roaming country changes Then event notification "roaming-change-country" is received on callback-url @@ -125,7 +125,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta Given that subscriptions are created synchronously And a valid subscription request body And the request body property "$.subscriptionExpireTime" is set to a value in the near future - When the request "createSubscription" is sent + When the request "createDeviceRoamingStatusSubscription" is sent Then the response code is 201 And the subscription is expired And event notification "subscription-ends" is received on callback-url @@ -139,7 +139,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta And a valid subscription request body And the request body property "$.type" is "roaming_on" And the request body property "$.subscriptionMaxEvents" is set to 1 - When the request "createSubscription" is sent + When the request "createDeviceRoamingStatusSubscription" is sent Then the response code is 201 Then event notification "roaming_on" is received on callback-url Then event notification "subscription-ends" is received on callback-url @@ -151,9 +151,9 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta Scenario: Receive notification for subscription-ends event on deletion Given that subscriptions are created synchronously And a valid subscription request body - When the request "createSubscription" is sent + When the request "createDeviceRoamingStatusSubscription" is sent Then the response code is 201 - When the request "deleteRoamingStatusSubscription" is sent + When the request "deleteSubscription" is sent Then the response code is 202 or 204 Then event notification "subscription-ends" is received on callback-url And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnds" @@ -166,7 +166,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta @roaming_status_subscriptions_14_Create_roaming_status_subscription_with_invalid_parameter Scenario: Create subscription with invalid parameter Given the request body is not compliant with the schema "/components/schemas/SubscriptionRequest" - When the request "createSubscription" is sent + When the request "createDeviceRoamingStatusSubscription" is sent Then the response code is 400 And the response property "$.status" is 400 And the response property "$.code" is "INVALID_ARGUMENT" @@ -176,7 +176,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta Scenario: Expiry time in past Given a valid subscription request body And request body property "$.subscriptionExpireTime" in past - When the request "createSubscription" is sent + When the request "createDeviceRoamingStatusSubscription" is sent Then the response code is 400 And the response property "$.status" is 400 And the response property "$.code" is "INVALID_ARGUMENT" @@ -186,7 +186,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta Scenario: subscription creation with invalid protocol Given a valid subscription request body And the request property "$.protocol" is not "HTTP" - When the request "createSubscription" is sent + When the request "createDeviceRoamingStatusSubscription" is sent Then the response property "$.status" is 400 And the response property "$.code" is "INVALID_PROTOCOL" And the response property "$.message" contains a user friendly text @@ -195,7 +195,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta Scenario: subscription creation with invalid credential type Given a valid subscription request body And the request property "$.credentialType" is not "ACCESSTOKEN" - When the request "createSubscription" is sent + When the request "createDeviceRoamingStatusSubscription" is sent Then the response property "$.status" is 400 And the response property "$.code" is "INVALID_CREDENTIAL" And the response property "$.message" contains a user friendly text @@ -204,7 +204,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta Scenario: subscription creation with invalid access token type Given a valid subscription request body And the request property "$.accessTokenType" is not "bearer" - When the request "createSubscription" is sent + When the request "createDeviceRoamingStatusSubscription" is sent Then the response property "$.status" is 400 And the response property "$.code" is "INVALID_TOKEN" or "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text @@ -213,7 +213,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta Scenario: subscription creation with invalid credentials Given a valid subscription request body And header "Authorization" token is set to invalid credentials - When the request "createSubscription" is sent + When the request "createDeviceRoamingStatusSubscription" is sent Then the response property "$.status" is 401 And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text @@ -224,7 +224,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta Given a valid subscription request body And the request body property "$.device" is set to a valid testing device supported by the service And header "Authorization" set to access token referring different device - When the request "createSubscription" is sent + When the request "createDeviceRoamingStatusSubscription" is sent Then the response property "$.status" is 403 And the response property "$.code" is "SUBSCRIPTION_MISMATCH" And the response property "$.message" contains a user friendly text @@ -232,7 +232,7 @@ Feature: Device Roaming Status Subscriptions API, v0.6.0 - Operations RoamingSta @roaming_status_subscription_21_unknown_subscription_id Scenario: Get subscription when subscription-id is unknown to the system Given the path parameter property "$.subscriptionId" is unknown to the system - When the request "retrieveRoamingStatusSubscription" is sent + When the request "retrieveSubscription" is sent Then the response property "$.status" is 404 And the response property "$.code" is "NOT_FOUND" And the response property "$.message" contains a user friendly text