From ddfc1d4289807d96646d123d23535aed6f81830b Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Mon, 8 Apr 2024 13:12:56 +0530 Subject: [PATCH 01/43] Geofencing feature file Geofencing feature file --- code/Test_definitions/Geofencing.feature | 118 +++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 code/Test_definitions/Geofencing.feature diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature new file mode 100644 index 00000000..8ba2d8db --- /dev/null +++ b/code/Test_definitions/Geofencing.feature @@ -0,0 +1,118 @@ +#- +# ---license-start +# CAMARA Project +# --- +# Copyright (C) 2023 - 2024 Contributors | Deutsche Telekom AG to CAMARA a Series +# +# The contributor of this file confirms his sign-off for the +# Developer Certificate of Origin +# (http://developercertificate.org). +# --- +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ---license-end + + @Geofencing +Feature: Operations to manage event subscription on geofencing events for leaving and entering in an area + + @geofencing_01_Create_geofencing_subscription_for_a_device + Scenario: Create geofencing subscription + Given they use the geofencing url + When they create subscription + Then Response code is 201 + + @geofencing_02_Operation_to_retrieve_list_of_subscriptions.--Not yet implemented + Scenario: Get a list of subscriptions. + Given they use the geofencing url + When they get all subscriptions + Then Response code is 200 + + + @geofencing_03_Operation_to_retrieve_subscription_based_on_the_provided_ID + Scenario: Get a subscription based on provided id. + Given they use the geofencing url + When they get subscription for subscription-id + Then Response code is 200 + + @geofencing_04_Operation_to_delete_subscription_based_on_the_provided_ID + Scenario: Delete a subscription based on provided id. + Given they use the geofencing url + When they delete subscription for subscription-id + Then Response code is 204 + + @geofencing_05_Create_invalid_geofencing_subscription_for_a_device + Scenario: Create geofencing subscription with invalid parameter + Given they use the geofencing url + When they create subscription with invalid parameter + Then Response code is 400 + + @geofencing_06_Get_invalid_geofencing_subscription_for_a_device + Scenario: Get geofencing subscription with invalid parameter + Given they use the geofencing url + When they get subscription with invalid subscription-id + Then Response code is 404 + + + @geofencing_07_Delete_invalid_geofencing_subscription_for_a_device + Scenario: Delete geofencing subscription with invalid parameter + Given they use the geofencing url + When they delete subscription with invalid subscription-id + Then Response code is 404 + + @geofencing_08_Invalid_method_geofencing_subscription_for_a_device + Scenario: Update geofencing subscription + Given they use the geofencing url + When they update subscription + Then Response code is 405 + + + @geofencing_09_creation_of_subscription_for_subscribed_expired_time_in_past + Scenario: Subscribed expire time in past for geofencing subscription + Given they use the geofencing url + When they create subscription with expire time in past + Then Response code is 400 + + + @geofencing_10_creation_of_subscription_when_service_unavailable + Scenario: Subscription creation when service unavailable + Given they use the geofencing url + When they create subscription when service is unavailable + Then Response code is not 503 + + @geofencing_11_Get_Event-Details_of_subscription_entered + Scenario: Subscription creation when service have area-entered event + Given they use the geofencing url + When they create subscription with event have area-entered at "Boon" + When they create subscription with event have area-entered at "Berlin" and device enters "Berlin" + Then they get event details from notifications-url + Then Response code is 200 + + @geofencing_12_Get_Event-Details_of_subscription_left + Scenario: Subscription creation when service have area-left event + Given they use the geofencing url + When they create subscription with event have area-left with at "Boon" + When they create subscription with event have area-left with at "Berlin" and device left "Boon" + Then they get event details from notifications-url + Then Response code is 200 + + @geofencing_13_Getting_of_subscription_when_service_unavailable + Scenario: Getting Subscription when service unavailable + Given they use the geofencing url + When they get subscription when service is unavailable + Then Response code is not 503 + + + @geofencing_14_Deletion_of_subscription_when_service_unavailable + Scenario: Deletion Subscription when service unavailable + Given they use the geofencing url + When they delete subscription when service is unavailable + Then Response code is not 503 From 95bd04bac925fa1190e31b7fb4c2f9c3aa864bd1 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Mon, 15 Apr 2024 12:46:06 +0530 Subject: [PATCH 02/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 8ba2d8db..082c1c5d 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -30,7 +30,7 @@ Feature: Operations to manage event subscription on geofencing events for leavin When they create subscription Then Response code is 201 - @geofencing_02_Operation_to_retrieve_list_of_subscriptions.--Not yet implemented + @geofencing_02_Operation_to_retrieve_list_of_subscriptions Scenario: Get a list of subscriptions. Given they use the geofencing url When they get all subscriptions From bb2df5023e4f9d3d40e190edfeb2fe5981cf897c Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Fri, 19 Jul 2024 12:30:28 +0530 Subject: [PATCH 03/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 45 +++++++++--------------- 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 082c1c5d..ee1f56eb 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -1,28 +1,17 @@ -#- -# ---license-start -# CAMARA Project -# --- -# Copyright (C) 2023 - 2024 Contributors | Deutsche Telekom AG to CAMARA a Series -# -# The contributor of this file confirms his sign-off for the -# Developer Certificate of Origin -# (http://developercertificate.org). -# --- -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ---license-end - - @Geofencing -Feature: Operations to manage event subscription on geofencing events for leaving and entering in an area + + +@Geofencing +Feature: Camara Geofencing Subscriptions API ,0.2.0-rc3 Operations on subscriptions + +# Input to be provided by the implementation to the tests +# References to OAS spec schemas refer to schemas specified in geofencing-subscriptions.yaml, version v0.2.0-rc3 + + Background: Common Geofencing Subscriptions setup + Given the resource "/geofencing-subscriptions/v0/subscriptions" as geofencing Url | + 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 @geofencing_01_Create_geofencing_subscription_for_a_device Scenario: Create geofencing subscription @@ -100,19 +89,19 @@ Feature: Operations to manage event subscription on geofencing events for leavin Scenario: Subscription creation when service have area-left event Given they use the geofencing url When they create subscription with event have area-left with at "Boon" - When they create subscription with event have area-left with at "Berlin" and device left "Boon" + When they create subscription with event have area-left with at "Berlin" and device left "Boon" Then they get event details from notifications-url Then Response code is 200 @geofencing_13_Getting_of_subscription_when_service_unavailable - Scenario: Getting Subscription when service unavailable + Scenario: Getting Subscription when service is unavailable Given they use the geofencing url When they get subscription when service is unavailable Then Response code is not 503 @geofencing_14_Deletion_of_subscription_when_service_unavailable - Scenario: Deletion Subscription when service unavailable + Scenario: Deletion of Subscription when service unavailable Given they use the geofencing url When they delete subscription when service is unavailable Then Response code is not 503 From a5221b152410dafe42be1044413bda7600079626 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Fri, 19 Jul 2024 12:40:27 +0530 Subject: [PATCH 04/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 43 ++++++++++++++---------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index ee1f56eb..a263e65f 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -13,71 +13,71 @@ Feature: Camara Geofencing Subscriptions API ,0.2.0-rc3 Operations on subscripti 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 - @geofencing_01_Create_geofencing_subscription_for_a_device + @geofencing_subscriptions_01_Create_geofencing_subscription_for_a_device Scenario: Create geofencing subscription Given they use the geofencing url When they create subscription Then Response code is 201 - @geofencing_02_Operation_to_retrieve_list_of_subscriptions + @geofencing_subscriptions_02_Operation_to_retrieve_list_of_subscriptions Scenario: Get a list of subscriptions. Given they use the geofencing url When they get all subscriptions Then Response code is 200 - @geofencing_03_Operation_to_retrieve_subscription_based_on_the_provided_ID + @geofencing_subscriptions_03_Operation_to_retrieve_subscription_based_on_the_provided_ID Scenario: Get a subscription based on provided id. Given they use the geofencing url When they get subscription for subscription-id Then Response code is 200 - @geofencing_04_Operation_to_delete_subscription_based_on_the_provided_ID + @geofencing_subscriptions_04_Operation_to_delete_subscription_based_on_the_provided_ID Scenario: Delete a subscription based on provided id. Given they use the geofencing url When they delete subscription for subscription-id Then Response code is 204 - @geofencing_05_Create_invalid_geofencing_subscription_for_a_device + @geofencing_subscriptions_05_Create_invalid_geofencing_subscription_for_a_device Scenario: Create geofencing subscription with invalid parameter Given they use the geofencing url When they create subscription with invalid parameter Then Response code is 400 - @geofencing_06_Get_invalid_geofencing_subscription_for_a_device - Scenario: Get geofencing subscription with invalid parameter + @geofencing_subscriptions_06_Get_invalid_geofencing_subscription_for_a_device + Scenario: Get geofencing subscription with invalid subscription-id which is not available Given they use the geofencing url - When they get subscription with invalid subscription-id + When they get subscription with invalid subscription-id which is not available Then Response code is 404 - @geofencing_07_Delete_invalid_geofencing_subscription_for_a_device + @geofencing_subscriptions_07_Delete_invalid_geofencing_subscription_for_a_device Scenario: Delete geofencing subscription with invalid parameter Given they use the geofencing url When they delete subscription with invalid subscription-id Then Response code is 404 - @geofencing_08_Invalid_method_geofencing_subscription_for_a_device + @geofencing_subscriptions_08_Invalid_method_geofencing_subscription_for_a_device Scenario: Update geofencing subscription Given they use the geofencing url When they update subscription Then Response code is 405 - @geofencing_09_creation_of_subscription_for_subscribed_expired_time_in_past + @geofencing_subscriptions_09_creation_of_subscription_for_subscribed_expired_time_in_past Scenario: Subscribed expire time in past for geofencing subscription Given they use the geofencing url When they create subscription with expire time in past Then Response code is 400 - @geofencing_10_creation_of_subscription_when_service_unavailable + @geofencing_subscriptions_10_creation_of_subscription_when_service_unavailable Scenario: Subscription creation when service unavailable Given they use the geofencing url When they create subscription when service is unavailable Then Response code is not 503 - @geofencing_11_Get_Event-Details_of_subscription_entered + @geofencing_subscriptions_11_Get_Event-Details_of_subscription_entered Scenario: Subscription creation when service have area-entered event Given they use the geofencing url When they create subscription with event have area-entered at "Boon" @@ -85,7 +85,7 @@ Feature: Camara Geofencing Subscriptions API ,0.2.0-rc3 Operations on subscripti Then they get event details from notifications-url Then Response code is 200 - @geofencing_12_Get_Event-Details_of_subscription_left + @geofencing_subscriptions_12_Get_Event-Details_of_subscription_left Scenario: Subscription creation when service have area-left event Given they use the geofencing url When they create subscription with event have area-left with at "Boon" @@ -93,15 +93,22 @@ Feature: Camara Geofencing Subscriptions API ,0.2.0-rc3 Operations on subscripti Then they get event details from notifications-url Then Response code is 200 - @geofencing_13_Getting_of_subscription_when_service_unavailable + @geofencing_subscriptions_13_Getting_of_subscription_when_service_unavailable Scenario: Getting Subscription when service is unavailable Given they use the geofencing url When they get subscription when service is unavailable - Then Response code is not 503 + Then Response code is 503 - @geofencing_14_Deletion_of_subscription_when_service_unavailable + @geofencing_subscriptions_14_Deletion_of_subscription_when_service_unavailable Scenario: Deletion of Subscription when service unavailable Given they use the geofencing url When they delete subscription when service is unavailable - Then Response code is not 503 + Then Response code is 503 + + + @geofencing_subscriptions_06_Get_invalid_geofencing_subscription_for_a_device + Scenario: Get geofencing subscription with invalid subscription-id format + Given they use the geofencing url + When they get subscription with invalid subscription-id which is in invalid format + Then Response code is 400 From 296c1112fa6a5a609a163dcfec8c3ed8c8fb503c Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Fri, 19 Jul 2024 13:06:42 +0530 Subject: [PATCH 05/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index a263e65f..0a05b8f5 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -107,7 +107,7 @@ Feature: Camara Geofencing Subscriptions API ,0.2.0-rc3 Operations on subscripti Then Response code is 503 - @geofencing_subscriptions_06_Get_invalid_geofencing_subscription_for_a_device + @geofencing_subscriptions_15_Get_invalid_geofencing_subscription_for_a_device Scenario: Get geofencing subscription with invalid subscription-id format Given they use the geofencing url When they get subscription with invalid subscription-id which is in invalid format From 7b39f8a94da9e10242521922c1fa56267396fc97 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Mon, 12 Aug 2024 12:24:35 +0530 Subject: [PATCH 06/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 0a05b8f5..f154bf12 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -1,13 +1,13 @@ @Geofencing -Feature: Camara Geofencing Subscriptions API ,0.2.0-rc3 Operations on subscriptions +Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions # Input to be provided by the implementation to the tests -# References to OAS spec schemas refer to schemas specified in geofencing-subscriptions.yaml, version v0.2.0-rc3 +# References to OAS spec schemas refer to schemas specified in geofencing-subscriptions.yaml, version v0.3.0 Background: Common Geofencing Subscriptions setup - Given the resource "/geofencing-subscriptions/v0/subscriptions" as geofencing Url | + Given the resource "/geofencing-subscriptions/v0.3/subscriptions" as geofencing Url | 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 @@ -26,10 +26,10 @@ Feature: Camara Geofencing Subscriptions API ,0.2.0-rc3 Operations on subscripti Then Response code is 200 - @geofencing_subscriptions_03_Operation_to_retrieve_subscription_based_on_the_provided_ID - Scenario: Get a subscription based on provided id. + @geofencing_subscriptions_03_Operation_to_retrieve_subscription_based_on_the_existing-subcription_ID + Scenario: Get a subscription based on existing-subcription id. Given they use the geofencing url - When they get subscription for subscription-id + When they get subscription for existing subscription-id Then Response code is 200 @geofencing_subscriptions_04_Operation_to_delete_subscription_based_on_the_provided_ID @@ -80,16 +80,16 @@ Feature: Camara Geofencing Subscriptions API ,0.2.0-rc3 Operations on subscripti @geofencing_subscriptions_11_Get_Event-Details_of_subscription_entered Scenario: Subscription creation when service have area-entered event Given they use the geofencing url - When they create subscription with event have area-entered at "Boon" - When they create subscription with event have area-entered at "Berlin" and device enters "Berlin" + When they create subscription with event have area-entered at "Place1" + When they create subscription with event have area-entered at "Place2" and device enters "Place2" Then they get event details from notifications-url Then Response code is 200 @geofencing_subscriptions_12_Get_Event-Details_of_subscription_left Scenario: Subscription creation when service have area-left event Given they use the geofencing url - When they create subscription with event have area-left with at "Boon" - When they create subscription with event have area-left with at "Berlin" and device left "Boon" + When they create subscription with event have area-left with at "Place1" + When they create subscription with event have area-left with at "Place2" and device left "Place1" Then they get event details from notifications-url Then Response code is 200 From de6e32cf49322441e0111fb83b314bdf1b553514 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Mon, 12 Aug 2024 12:36:04 +0530 Subject: [PATCH 07/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index f154bf12..e3813d45 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -44,7 +44,7 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions When they create subscription with invalid parameter Then Response code is 400 - @geofencing_subscriptions_06_Get_invalid_geofencing_subscription_for_a_device + @geofencing_subscriptions_06_Get_unknown_geofencing_subscription_for_a_device Scenario: Get geofencing subscription with invalid subscription-id which is not available Given they use the geofencing url When they get subscription with invalid subscription-id which is not available @@ -112,3 +112,10 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions Given they use the geofencing url When they get subscription with invalid subscription-id which is in invalid format Then Response code is 400 + + + @geofencing_subscriptions_16_Delete_invalid_geofencing_subscription_for_a_device + Scenario: Get geofencing subscription with invalid subscription-id format + Given they use the geofencing url + When they delete subscription with invalid subscription-id which is in invalid format + Then Response code is 400 From a3d58ba6f1669ec646dbf21101ad0fc34a59b610 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Mon, 12 Aug 2024 13:08:26 +0530 Subject: [PATCH 08/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 1 - 1 file changed, 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index e3813d45..04e8cb98 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -113,7 +113,6 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions When they get subscription with invalid subscription-id which is in invalid format Then Response code is 400 - @geofencing_subscriptions_16_Delete_invalid_geofencing_subscription_for_a_device Scenario: Get geofencing subscription with invalid subscription-id format Given they use the geofencing url From b806c653185737c690465dee6a00c1a6905318bf Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Tue, 13 Aug 2024 00:00:39 +0530 Subject: [PATCH 09/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 126 +++++++++++++++++++---- 1 file changed, 107 insertions(+), 19 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 04e8cb98..4a1aefd2 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -15,106 +15,194 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions @geofencing_subscriptions_01_Create_geofencing_subscription_for_a_device Scenario: Create geofencing subscription - Given they use the geofencing url - When they create subscription - Then Response code is 201 + Given the appropriate values are used for geofencing + When the creation of subscription is performed + 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" + # The response has to comply with the generic response schema which is part of the spec + And the response body complies with the OAS schema at "/components/schemas/Subscription" + @geofencing_subscriptions_02_Operation_to_retrieve_list_of_subscriptions Scenario: Get a list of subscriptions. - Given they use the geofencing url + Given the appropriate values are used for geofencing When they get all subscriptions Then 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" + # The response has to comply with the generic response schema which is part of the spec + And the response body complies with the OAS schema at "/components/schemas/Subscription" @geofencing_subscriptions_03_Operation_to_retrieve_subscription_based_on_the_existing-subcription_ID Scenario: Get a subscription based on existing-subcription id. - Given they use the geofencing url + Given the appropriate values are used for geofencing When they get subscription for existing subscription-id Then 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" + # The response has to comply with the generic response schema which is part of the spec + And the response body complies with the OAS schema at "/components/schemas/Subscription" + @geofencing_subscriptions_04_Operation_to_delete_subscription_based_on_the_provided_ID Scenario: Delete a subscription based on provided id. - Given they use the geofencing url + Given the appropriate values are used for geofencing When they delete subscription for subscription-id 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" + # The response has to comply with the generic response schema which is part of the spec + And the response body complies with the OAS schema at "/components/schemas/Subscription" + @geofencing_subscriptions_05_Create_invalid_geofencing_subscription_for_a_device Scenario: Create geofencing subscription with invalid parameter - Given they use the geofencing url + Given the appropriate values are used for geofencing When they create subscription with invalid parameter 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 @geofencing_subscriptions_06_Get_unknown_geofencing_subscription_for_a_device Scenario: Get geofencing subscription with invalid subscription-id which is not available - Given they use the geofencing url - When they get subscription with invalid subscription-id which is not available + Given the appropriate values are used for geofencing + When the get subscription with invalid subscription-id which is not available Then Response code is 404 + And the response property "$.status" is 404 + And the response property "$.code" is "NOT_FOUND" + And the response property "$.message" contains a user friendly text @geofencing_subscriptions_07_Delete_invalid_geofencing_subscription_for_a_device Scenario: Delete geofencing subscription with invalid parameter - Given they use the geofencing url + Given the appropriate values are used for geofencing When they delete subscription with invalid subscription-id Then Response code is 404 + And the response property "$.status" is 404 + And the response property "$.code" is "NOT_FOUND" + And the response property "$.message" contains a user friendly text @geofencing_subscriptions_08_Invalid_method_geofencing_subscription_for_a_device Scenario: Update geofencing subscription - Given they use the geofencing url + Given the appropriate values are used for geofencing When they update subscription Then Response code is 405 + And the response property "$.status" is 405 + And the response property "$.code" is "METHOD_NOT_ALLOWED" + And the response property "$.message" contains a user friendly text @geofencing_subscriptions_09_creation_of_subscription_for_subscribed_expired_time_in_past Scenario: Subscribed expire time in past for geofencing subscription - Given they use the geofencing url + Given the appropriate values are used for geofencing When they create subscription with expire time in 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 @geofencing_subscriptions_10_creation_of_subscription_when_service_unavailable Scenario: Subscription creation when service unavailable - Given they use the geofencing url + Given the appropriate values are used for geofencing When they create subscription when service is unavailable Then Response code is not 503 @geofencing_subscriptions_11_Get_Event-Details_of_subscription_entered Scenario: Subscription creation when service have area-entered event - Given they use the geofencing url + Given the appropriate values are used for geofencing When they create subscription with event have area-entered at "Place1" When they create subscription with event have area-entered at "Place2" and device enters "Place2" Then they get event details from notifications-url Then 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" + # The response has to comply with the generic response schema which is part of the spec + And the response body complies with the OAS schema at "/components/schemas/Subscription" @geofencing_subscriptions_12_Get_Event-Details_of_subscription_left Scenario: Subscription creation when service have area-left event - Given they use the geofencing url + Given the appropriate values are used for geofencing When they create subscription with event have area-left with at "Place1" When they create subscription with event have area-left with at "Place2" and device left "Place1" Then they get event details from notifications-url Then 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" + # The response has to comply with the generic response schema which is part of the spec + And the response body complies with the OAS schema at "/components/schemas/Subscription" @geofencing_subscriptions_13_Getting_of_subscription_when_service_unavailable Scenario: Getting Subscription when service is unavailable - Given they use the geofencing url + Given the appropriate values are used for geofencing When they get subscription when service is unavailable Then Response code is 503 @geofencing_subscriptions_14_Deletion_of_subscription_when_service_unavailable Scenario: Deletion of Subscription when service unavailable - Given they use the geofencing url + Given the appropriate values are used for geofencing When they delete subscription when service is unavailable Then Response code is 503 @geofencing_subscriptions_15_Get_invalid_geofencing_subscription_for_a_device Scenario: Get geofencing subscription with invalid subscription-id format - Given they use the geofencing url + Given the appropriate values are used for geofencing When they get subscription with invalid subscription-id which is in invalid format 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 @geofencing_subscriptions_16_Delete_invalid_geofencing_subscription_for_a_device Scenario: Get geofencing subscription with invalid subscription-id format - Given they use the geofencing url + Given the appropriate values are used for geofencing When they delete subscription with invalid subscription-id which is in invalid format 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 + + @geofencing_subscriptions_17_no_authorization_header + Scenario: No Authorization header + Given the header "Authorization" is removed + And the request body is set to a valid request body + When the HTTP "POST" request is sent + Then the response status 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 + + + @geofencing_subscriptions_18_expired_access_token + Scenario: Expired access token + Given the header "Authorization" is set to an expired access token + And the request body is set to a valid request body + When the HTTP "POST" request is sent + Then the response status 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 + + + @geofencing_subscriptions_19_invalid_access_token + Scenario: Invalid access token + Given the header "Authorization" is set to an invalid access token + And the request body is set to a valid request body + When the HTTP "POST" request is sent + Then the response status code is 401 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 401 + And the response property "$.code" is "UNAUTHENTICATED" + And the response property "$.message" contains a user friendly text + + + + Validate that the subscribed events are received in the sink, with the right sinkCredential, for those situations specified in the API. +For subscriptions that provide subscriptionExpireTime, validate that the subscribed events are not longer received after the expiration time. +For subscriptions that provide subscriptionMaxEvents, validate that the subscribed events are not longer received after the maximum events limit is reached. +Validate that after a subscription is deleted, the subscribed events are not longer received. From 422ca3c74457b44332105668c2895345d279399c Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Tue, 13 Aug 2024 00:36:09 +0530 Subject: [PATCH 10/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 131 ++++++++++++++++------- 1 file changed, 92 insertions(+), 39 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 4a1aefd2..3267840e 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -16,7 +16,7 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions @geofencing_subscriptions_01_Create_geofencing_subscription_for_a_device Scenario: Create geofencing subscription Given the appropriate values are used for geofencing - When the creation of subscription is performed + When the creation of subscription method is triggered is performed 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" @@ -27,8 +27,8 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions @geofencing_subscriptions_02_Operation_to_retrieve_list_of_subscriptions Scenario: Get a list of subscriptions. Given the appropriate values are used for geofencing - When they get all subscriptions - Then Response code is 200 + When the get all subscriptions method is triggered + 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" # The response has to comply with the generic response schema which is part of the spec @@ -38,8 +38,8 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions @geofencing_subscriptions_03_Operation_to_retrieve_subscription_based_on_the_existing-subcription_ID Scenario: Get a subscription based on existing-subcription id. Given the appropriate values are used for geofencing - When they get subscription for existing subscription-id - Then Response code is 200 + When the get subscription method is triggered for existing subscription-id + 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" # The response has to comply with the generic response schema which is part of the spec @@ -49,8 +49,8 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions @geofencing_subscriptions_04_Operation_to_delete_subscription_based_on_the_provided_ID Scenario: Delete a subscription based on provided id. Given the appropriate values are used for geofencing - When they delete subscription for subscription-id - Then Response code is 204 + When the delete subscription method is triggered for subscription-id + Then the 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" # The response has to comply with the generic response schema which is part of the spec @@ -60,8 +60,8 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions @geofencing_subscriptions_05_Create_invalid_geofencing_subscription_for_a_device Scenario: Create geofencing subscription with invalid parameter Given the appropriate values are used for geofencing - When they create subscription with invalid parameter - Then Response code is 400 + When the create subscription method is triggered with invalid parameter + 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 @@ -69,8 +69,8 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions @geofencing_subscriptions_06_Get_unknown_geofencing_subscription_for_a_device Scenario: Get geofencing subscription with invalid subscription-id which is not available Given the appropriate values are used for geofencing - When the get subscription with invalid subscription-id which is not available - Then Response code is 404 + When the get subscription method is triggered with invalid subscription-id which is not available + Then the response code is 404 And the response property "$.status" is 404 And the response property "$.code" is "NOT_FOUND" And the response property "$.message" contains a user friendly text @@ -79,8 +79,8 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions @geofencing_subscriptions_07_Delete_invalid_geofencing_subscription_for_a_device Scenario: Delete geofencing subscription with invalid parameter Given the appropriate values are used for geofencing - When they delete subscription with invalid subscription-id - Then Response code is 404 + When the delete subscription method is triggered with invalid subscription-id + Then the response code is 404 And the response property "$.status" is 404 And the response property "$.code" is "NOT_FOUND" And the response property "$.message" contains a user friendly text @@ -88,8 +88,8 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions @geofencing_subscriptions_08_Invalid_method_geofencing_subscription_for_a_device Scenario: Update geofencing subscription Given the appropriate values are used for geofencing - When they update subscription - Then Response code is 405 + When the update subscription method is triggered + Then the response code is 405 And the response property "$.status" is 405 And the response property "$.code" is "METHOD_NOT_ALLOWED" And the response property "$.message" contains a user friendly text @@ -98,8 +98,8 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions @geofencing_subscriptions_09_creation_of_subscription_for_subscribed_expired_time_in_past Scenario: Subscribed expire time in past for geofencing subscription Given the appropriate values are used for geofencing - When they create subscription with expire time in past - Then Response code is 400 + When the create subscription method is triggered with expire time in past + 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 @@ -108,16 +108,19 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions @geofencing_subscriptions_10_creation_of_subscription_when_service_unavailable Scenario: Subscription creation when service unavailable Given the appropriate values are used for geofencing - When they create subscription when service is unavailable - Then Response code is not 503 + When the create subscription method is triggered when service is unavailable + Then the response code is not 503 + And the response property "$.status" is 503 + And the response property "$.code" is "UNAVAILABLE" + And the response property "$.message" contains a user friendly text @geofencing_subscriptions_11_Get_Event-Details_of_subscription_entered Scenario: Subscription creation when service have area-entered event Given the appropriate values are used for geofencing - When they create subscription with event have area-entered at "Place1" - When they create subscription with event have area-entered at "Place2" and device enters "Place2" - Then they get event details from notifications-url - Then Response code is 200 + When the create subscription with event have area-entered at "Place1" + When the create subscription with event have area-entered at "Place2" and device enters "Place2" + Then the get event details from notifications-url + 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" # The response has to comply with the generic response schema which is part of the spec @@ -126,10 +129,10 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions @geofencing_subscriptions_12_Get_Event-Details_of_subscription_left Scenario: Subscription creation when service have area-left event Given the appropriate values are used for geofencing - When they create subscription with event have area-left with at "Place1" - When they create subscription with event have area-left with at "Place2" and device left "Place1" + When the create subscription with event have area-left with at "Place1" + When the create subscription with event have area-left with at "Place2" and device left "Place1" Then they get event details from notifications-url - Then Response code is 200 + 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" # The response has to comply with the generic response schema which is part of the spec @@ -138,31 +141,37 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions @geofencing_subscriptions_13_Getting_of_subscription_when_service_unavailable Scenario: Getting Subscription when service is unavailable Given the appropriate values are used for geofencing - When they get subscription when service is unavailable - Then Response code is 503 + When the get subscription method is triggered when service is unavailable + Then the response code is 503 + And the response property "$.status" is 503 + And the response property "$.code" is "UNAVAILABLE" + And the response property "$.message" contains a user friendly text @geofencing_subscriptions_14_Deletion_of_subscription_when_service_unavailable Scenario: Deletion of Subscription when service unavailable Given the appropriate values are used for geofencing - When they delete subscription when service is unavailable - Then Response code is 503 + When the delete subscription method is triggered when service is unavailable + Then the response code is 503 + And the response property "$.status" is 503 + And the response property "$.code" is "UNAVAILABLE" + And the response property "$.message" contains a user friendly text @geofencing_subscriptions_15_Get_invalid_geofencing_subscription_for_a_device Scenario: Get geofencing subscription with invalid subscription-id format Given the appropriate values are used for geofencing - When they get subscription with invalid subscription-id which is in invalid format - Then Response code is 400 + When the get subscription method is triggered with invalid subscription-id which is in invalid format + 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 - @geofencing_subscriptions_16_Delete_invalid_geofencing_subscription_for_a_device + @geofencing_subscriptions_16_Delete_invalid_geofencing_subscription_for_a_device Scenario: Get geofencing subscription with invalid subscription-id format Given the appropriate values are used for geofencing - When they delete subscription with invalid subscription-id which is in invalid format - Then Response code is 400 + When the delete subscription method is triggered with invalid subscription-id which is in invalid format + 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 @@ -200,9 +209,53 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text + @geofencing_subscriptions_20_sink_credentials + Scenario: Validate that the subscribed events are received in the sink, with the right sinkCredential, for those situations specified in the API. + Given the appropriate values are used for geofencing + When the create subscription method is triggered for subscription-id + Then the response code is 201 + Then the get event details observed on notifications-url + Then the subscribed event received on notifications-url & sink credentials are as expected + 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" + # The response has to comply with the generic response schema which is part of the spec + And the response body complies with the OAS schema at "/components/schemas/Subscription" + + + + @geofencing_subscriptions_21_subscriptionExpireTime + Scenario: For subscriptions that provide subscriptionExpireTime, validate that the subscribed events are not longer received after the expiration time. + Given the appropriate values are used for geofencing + When the create subscription method is triggered for subscription-id with subscriptionExpireTime after 5 seconds + Then the subscriptionExpireTime value is reached + Then the get event details observed on notifications-url + Then the response code is 404 + And the response property "$.status" is 404 + And the response property "$.code" is "NOT_FOUND" + And the response property "$.message" contains a user friendly text - Validate that the subscribed events are received in the sink, with the right sinkCredential, for those situations specified in the API. -For subscriptions that provide subscriptionExpireTime, validate that the subscribed events are not longer received after the expiration time. -For subscriptions that provide subscriptionMaxEvents, validate that the subscribed events are not longer received after the maximum events limit is reached. -Validate that after a subscription is deleted, the subscribed events are not longer received. + @geofencing_subscriptions_22_subscriptionMaxEvents + Scenario: For subscriptions that provide subscriptionMaxEvents, validate that the subscribed events are not longer received after the maximum events limit is reached. + Given the appropriate values are used for geofencing + When the create subscription method is triggered for subscription-id + Then the response code is 201 + Then the create subscription method is triggered for subscription-id + Then the subscriptionMaxEvents value is exceeded + Then the get event details observed on notifications-url + Then the response code is 404 + And the response property "$.status" is 404 + And the response property "$.code" is "NOT_FOUND" + And the response property "$.message" contains a user friendly text + + @geofencing_subscriptions_23_subscription_deleted_event_validation + Scenario: Validate that after a subscription is deleted, the subscribed events are not longer received. + Given the appropriate values are used for geofencing + When the delete subscription method is triggered for subscription-id + Then the response code is 204 + Then the get event details observed on notifications-url + Then the response code is 404 + And 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 0a37af2b46a89d6e6f56a0af049f837630343da6 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Fri, 23 Aug 2024 23:47:22 +0530 Subject: [PATCH 11/43] Update code/Test_definitions/Geofencing.feature Co-authored-by: Jose Luis Urien --- code/Test_definitions/Geofencing.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 3267840e..09eb9c22 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -37,7 +37,7 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions @geofencing_subscriptions_03_Operation_to_retrieve_subscription_based_on_the_existing-subcription_ID Scenario: Get a subscription based on existing-subcription id. - Given the appropriate values are used for geofencing + Given the path parameter "subscriptionId" is set to the identifier of an existing subscription When the get subscription method is triggered for existing subscription-id Then the response code is 200 And the response header "Content-Type" is "application/json" From 368ac665a879eb333858e0e39451b2b87ffbe0e3 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Fri, 23 Aug 2024 23:47:54 +0530 Subject: [PATCH 12/43] Update code/Test_definitions/Geofencing.feature Co-authored-by: Jose Luis Urien --- code/Test_definitions/Geofencing.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 09eb9c22..a4af0e0d 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -32,7 +32,7 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" # The response has to comply with the generic response schema which is part of the spec - And the response body complies with the OAS schema at "/components/schemas/Subscription" + And each item in the response body, if any, complies with the OAS schema at "/components/schemas/Subscription" @geofencing_subscriptions_03_Operation_to_retrieve_subscription_based_on_the_existing-subcription_ID From ce8b8975cf726afcdc792292561087e60a0f25f5 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Mon, 26 Aug 2024 09:59:26 +0530 Subject: [PATCH 13/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 55 +++++++++++------------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index a4af0e0d..b6678486 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -7,11 +7,10 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions # References to OAS spec schemas refer to schemas specified in geofencing-subscriptions.yaml, version v0.3.0 Background: Common Geofencing Subscriptions setup - Given the resource "/geofencing-subscriptions/v0.3/subscriptions" as geofencing Url | + Given the resource "/geofencing-subscriptions/v0.3/" as geofencing base-url | 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 @geofencing_subscriptions_01_Create_geofencing_subscription_for_a_device Scenario: Create geofencing subscription @@ -224,38 +223,36 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions - @geofencing_subscriptions_21_subscriptionExpireTime + @geofencing_subscriptions_21_subscriptionExpireTime Scenario: For subscriptions that provide subscriptionExpireTime, validate that the subscribed events are not longer received after the expiration time. - Given the appropriate values are used for geofencing - When the create subscription method is triggered for subscription-id with subscriptionExpireTime after 5 seconds - Then the subscriptionExpireTime value is reached - Then the get event details observed on notifications-url - Then the response code is 404 - And the response property "$.status" is 404 - And the response property "$.code" is "NOT_FOUND" - And the response property "$.message" contains a user friendly text + Given the appropriate values are used for geofencing base-url + When the create subscription method is triggered for less $.duration + Then the subscriptionExpireTime value is reached and subscription is expired + Then the get method called for checking event details on notifications-callback-url when device enters geofence + Then no event received on notifications-callback-url + Then the get method called for checking event details on notifications-url when device leaves geofence + Then no event received on notifications-callback-url @geofencing_subscriptions_22_subscriptionMaxEvents Scenario: For subscriptions that provide subscriptionMaxEvents, validate that the subscribed events are not longer received after the maximum events limit is reached. - Given the appropriate values are used for geofencing - When the create subscription method is triggered for subscription-id + Given the appropriate values are used for geofencing base-url + When the create subscription method is triggered Then the response code is 201 - Then the create subscription method is triggered for subscription-id - Then the subscriptionMaxEvents value is exceeded - Then the get event details observed on notifications-url - Then the response code is 404 - And the response property "$.status" is 404 - And the response property "$.code" is "NOT_FOUND" - And the response property "$.message" contains a user friendly text - - @geofencing_subscriptions_23_subscription_deleted_event_validation + Then the maxevents are already triggered for available subscription + Then the get method called for checking event details on notifications-callback-url when device enters geofence + Then no event received on notifications-callback-url + Then the get method called for checking event details on notifications-url when device leaves geofence + Then no event received on notifications-callback-url + + + @geofencing_subscriptions_23_subscription_delete_event_validation Scenario: Validate that after a subscription is deleted, the subscribed events are not longer received. - Given the appropriate values are used for geofencing - When the delete subscription method is triggered for subscription-id + Given the appropriate values are used for geofencing base-url + When the delete subscription method is triggered Then the response code is 204 - Then the get event details observed on notifications-url - Then the response code is 404 - And the response property "$.status" is 404 - And the response property "$.code" is "NOT_FOUND" - And the response property "$.message" contains a user friendly text + Then the get method called for checking event details on notifications-callback-url when device enters geofence + Then no event received on notifications-callback-url + Then the get method called for checking event details on notifications-url when device leaves geofence + Then no event received on notifications-callback-url + From 36ccd728e2bc0c1054ec54eae8e8dde0d4146f46 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Mon, 26 Aug 2024 10:13:38 +0530 Subject: [PATCH 14/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index b6678486..d655feb2 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -7,7 +7,7 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions # References to OAS spec schemas refer to schemas specified in geofencing-subscriptions.yaml, version v0.3.0 Background: Common Geofencing Subscriptions setup - Given the resource "/geofencing-subscriptions/v0.3/" as geofencing base-url | + Given the resource "{apiroot}/geofencing-subscriptions/v0.3/" as geofencing base-url | 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 @@ -152,7 +152,7 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions Given the appropriate values are used for geofencing When the delete subscription method is triggered when service is unavailable Then the response code is 503 - And the response property "$.status" is 503 + And the response property "$.status" is 503 And the response property "$.code" is "UNAVAILABLE" And the response property "$.message" contains a user friendly text @@ -208,20 +208,13 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - @geofencing_subscriptions_20_sink_credentials + @geofencing_subscriptions_20_sink_credentials Scenario: Validate that the subscribed events are received in the sink, with the right sinkCredential, for those situations specified in the API. - Given the appropriate values are used for geofencing - When the create subscription method is triggered for subscription-id - Then the response code is 201 - Then the get event details observed on notifications-url - Then the subscribed event received on notifications-url & sink credentials are as expected - 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" - # The response has to comply with the generic response schema which is part of the spec - And the response body complies with the OAS schema at "/components/schemas/Subscription" - - + Given the appropriate values are used for geofencing base-url + When the create subscription method is triggered with "sink" and "sinkcredentials" + Then the response code is 201 and subscription is created + Then the event details are observed on notifications-url + And the subscribed event received on notifications-callback-url & sink credentials are as expected @geofencing_subscriptions_21_subscriptionExpireTime Scenario: For subscriptions that provide subscriptionExpireTime, validate that the subscribed events are not longer received after the expiration time. From e1faaac7990bb03126535c07be631428aa3aa236 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Tue, 27 Aug 2024 00:29:47 +0530 Subject: [PATCH 15/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 166 ++++++++--------------- 1 file changed, 56 insertions(+), 110 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index d655feb2..39358680 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -1,65 +1,55 @@ - - @Geofencing -Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions +Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptions # Input to be provided by the implementation to the tests # References to OAS spec schemas refer to schemas specified in geofencing-subscriptions.yaml, version v0.3.0 Background: Common Geofencing Subscriptions setup Given the resource "{apiroot}/geofencing-subscriptions/v0.3/" as geofencing base-url | - 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 @geofencing_subscriptions_01_Create_geofencing_subscription_for_a_device Scenario: Create geofencing subscription - Given the appropriate values are used for geofencing - When the creation of subscription method is triggered is performed + Given 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" - # The response has to comply with the generic response schema which is part of the spec And the response body complies with the OAS schema at "/components/schemas/Subscription" - @geofencing_subscriptions_02_Operation_to_retrieve_list_of_subscriptions Scenario: Get a list of subscriptions. - Given the appropriate values are used for geofencing - When the get all subscriptions method is triggered - Then the response code is 200 + Given the request body is not available + When the "retrieveGeofencingSubscriptionList" 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" - # The response has to comply with the generic response schema which is part of the spec And each item in the response body, if any, complies with the OAS schema at "/components/schemas/Subscription" - - @geofencing_subscriptions_03_Operation_to_retrieve_subscription_based_on_the_existing-subcription_ID - Scenario: Get a subscription based on existing-subcription id. - Given the path parameter "subscriptionId" is set to the identifier of an existing subscription - When the get subscription method is triggered for existing subscription-id - Then the response code is 200 + @geofencing_subscriptions_03_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 "retrieveGeofencingSubscription" 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" - # The response has to comply with the generic response schema which is part of the spec And the response body complies with the OAS schema at "/components/schemas/Subscription" - @geofencing_subscriptions_04_Operation_to_delete_subscription_based_on_the_provided_ID - Scenario: Delete a subscription based on provided id. - Given the appropriate values are used for geofencing - When the delete subscription method is triggered for subscription-id - Then the response code is 204 - And the response header "Content-Type" is "application/json" + @geofencing_subscriptions_04_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 "deleteGeofencingSubscription" 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" - # The response has to comply with the generic response schema which is part of the spec - And the response body complies with the OAS schema at "/components/schemas/Subscription" - + And if response property $.status is 204 then response body is not available + @geofencing_subscriptions_05_Create_invalid_geofencing_subscription_for_a_device Scenario: Create geofencing subscription with invalid parameter - Given the appropriate values are used for geofencing - When the create subscription method is triggered with invalid parameter + Given a valid subscription request body + When the request "createSubscription" is sent with invalid parameter Then the response code is 400 And the response property "$.status" is 400 And the response property "$.code" is "INVALID_ARGUMENT" @@ -67,67 +57,43 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions @geofencing_subscriptions_06_Get_unknown_geofencing_subscription_for_a_device Scenario: Get geofencing subscription with invalid subscription-id which is not available - Given the appropriate values are used for geofencing - When the get subscription method is triggered with invalid subscription-id which is not available + Given the request body is not available and path parameter "subscriptionId" is set to the identifier of a non-existing subscription + When the request "retrieveGeofencingSubscription" is sent Then the response code is 404 And the response property "$.status" is 404 And the response property "$.code" is "NOT_FOUND" And the response property "$.message" contains a user friendly text - @geofencing_subscriptions_07_Delete_invalid_geofencing_subscription_for_a_device Scenario: Delete geofencing subscription with invalid parameter - Given the appropriate values are used for geofencing - When the delete subscription method is triggered with invalid subscription-id + Given the request body is not available and path parameter "subscriptionId" is set to the identifier of an existing non-subscription + When the request "deleteGeofencingSubscription" is sent Then the response code is 404 And the response property "$.status" is 404 And the response property "$.code" is "NOT_FOUND" And the response property "$.message" contains a user friendly text - @geofencing_subscriptions_08_Invalid_method_geofencing_subscription_for_a_device - Scenario: Update geofencing subscription - Given the appropriate values are used for geofencing - When the update subscription method is triggered - Then the response code is 405 - And the response property "$.status" is 405 - And the response property "$.code" is "METHOD_NOT_ALLOWED" - And the response property "$.message" contains a user friendly text - - @geofencing_subscriptions_09_creation_of_subscription_for_subscribed_expired_time_in_past + @geofencing_subscriptions_08_creation_of_subscription_for_subscribed_expired_time_in_past Scenario: Subscribed expire time in past for geofencing subscription - Given the appropriate values are used for geofencing - When the create subscription method is triggered with expire time in past + Given a valid subscription request body + When the request "createSubscription" is sent with expire time in past 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 - @geofencing_subscriptions_10_creation_of_subscription_when_service_unavailable - Scenario: Subscription creation when service unavailable - Given the appropriate values are used for geofencing - When the create subscription method is triggered when service is unavailable - Then the response code is not 503 - And the response property "$.status" is 503 - And the response property "$.code" is "UNAVAILABLE" - And the response property "$.message" contains a user friendly text - - @geofencing_subscriptions_11_Get_Event-Details_of_subscription_entered + @geofencing_subscriptions_09_Get_Event-Details_of_subscription_entered Scenario: Subscription creation when service have area-entered event - Given the appropriate values are used for geofencing + Given a valid subscription request body When the create subscription with event have area-entered at "Place1" When the create subscription with event have area-entered at "Place2" and device enters "Place2" - Then the get event details from notifications-url - 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" - # The response has to comply with the generic response schema which is part of the spec - And the response body complies with the OAS schema at "/components/schemas/Subscription" - - @geofencing_subscriptions_12_Get_Event-Details_of_subscription_left + Then the get event details on notifications-callback-url + + @geofencing_subscriptions_10_Get_Event-Details_of_subscription_left Scenario: Subscription creation when service have area-left event - Given the appropriate values are used for geofencing + Given a valid subscription request body When the create subscription with event have area-left with at "Place1" When the create subscription with event have area-left with at "Place2" and device left "Place1" Then they get event details from notifications-url @@ -137,45 +103,26 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions # The response has to comply with the generic response schema which is part of the spec And the response body complies with the OAS schema at "/components/schemas/Subscription" - @geofencing_subscriptions_13_Getting_of_subscription_when_service_unavailable - Scenario: Getting Subscription when service is unavailable - Given the appropriate values are used for geofencing - When the get subscription method is triggered when service is unavailable - Then the response code is 503 - And the response property "$.status" is 503 - And the response property "$.code" is "UNAVAILABLE" - And the response property "$.message" contains a user friendly text - - - @geofencing_subscriptions_14_Deletion_of_subscription_when_service_unavailable - Scenario: Deletion of Subscription when service unavailable - Given the appropriate values are used for geofencing - When the delete subscription method is triggered when service is unavailable - Then the response code is 503 - And the response property "$.status" is 503 - And the response property "$.code" is "UNAVAILABLE" - And the response property "$.message" contains a user friendly text - - @geofencing_subscriptions_15_Get_invalid_geofencing_subscription_for_a_device + @geofencing_subscriptions_11_Get_invalid_geofencing_subscription_for_a_device Scenario: Get geofencing subscription with invalid subscription-id format - Given the appropriate values are used for geofencing - When the get subscription method is triggered with invalid subscription-id which is in invalid format + Given the request body is not available and path parameter "subscriptionId" is set to the identifier with invalid subscription-id which is in invalid format + When the request "retrieveGeofencingSubscription" 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 - @geofencing_subscriptions_16_Delete_invalid_geofencing_subscription_for_a_device + @geofencing_subscriptions_12_Delete_invalid_geofencing_subscription_for_a_device Scenario: Get geofencing subscription with invalid subscription-id format - Given the appropriate values are used for geofencing - When the delete subscription method is triggered with invalid subscription-id which is in invalid format + Given the request body is not available and path parameter "subscriptionId" is set to the identifier of a non-existing subscription + When the request "deleteGeofencingSubscription" is sent with invalid subscription-id which is in invalid format 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 - @geofencing_subscriptions_17_no_authorization_header + @geofencing_subscriptions_13_no_authorization_header Scenario: No Authorization header Given the header "Authorization" is removed And the request body is set to a valid request body @@ -186,7 +133,7 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions And the response property "$.message" contains a user friendly text - @geofencing_subscriptions_18_expired_access_token + @geofencing_subscriptions_14_expired_access_token Scenario: Expired access token Given the header "Authorization" is set to an expired access token And the request body is set to a valid request body @@ -197,7 +144,7 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions And the response property "$.message" contains a user friendly text - @geofencing_subscriptions_19_invalid_access_token + @geofencing_subscriptions_15_invalid_access_token Scenario: Invalid access token Given the header "Authorization" is set to an invalid access token And the request body is set to a valid request body @@ -208,29 +155,29 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - @geofencing_subscriptions_20_sink_credentials + @geofencing_subscriptions_16_sink_credentials Scenario: Validate that the subscribed events are received in the sink, with the right sinkCredential, for those situations specified in the API. - Given the appropriate values are used for geofencing base-url - When the create subscription method is triggered with "sink" and "sinkcredentials" + Given a valid subscription request body + When the request "createSubscription" is sent with "sink" and "sinkcredentials" Then the response code is 201 and subscription is created Then the event details are observed on notifications-url And the subscribed event received on notifications-callback-url & sink credentials are as expected - @geofencing_subscriptions_21_subscriptionExpireTime + @geofencing_subscriptions_17_subscriptionExpireTime Scenario: For subscriptions that provide subscriptionExpireTime, validate that the subscribed events are not longer received after the expiration time. - Given the appropriate values are used for geofencing base-url - When the create subscription method is triggered for less $.duration - Then the subscriptionExpireTime value is reached and subscription is expired + Given a valid subscription request body + When the request "createSubscription" is sent for less $.duration + Then the subscriptionExpireTime ]breached and subscription is expired Then the get method called for checking event details on notifications-callback-url when device enters geofence Then no event received on notifications-callback-url - Then the get method called for checking event details on notifications-url when device leaves geofence + Then the get method called for checking event details on notifications-callback-url when device leaves geofence Then no event received on notifications-callback-url - @geofencing_subscriptions_22_subscriptionMaxEvents + @geofencing_subscriptions_18_subscriptionMaxEvents Scenario: For subscriptions that provide subscriptionMaxEvents, validate that the subscribed events are not longer received after the maximum events limit is reached. - Given the appropriate values are used for geofencing base-url - When the create subscription method is triggered + Given a valid subscription request body + When the request "createSubscription" is sent Then the response code is 201 Then the maxevents are already triggered for available subscription Then the get method called for checking event details on notifications-callback-url when device enters geofence @@ -239,13 +186,12 @@ Feature: Camara Geofencing Subscriptions API ,0.3.0 Operations on subscriptions Then no event received on notifications-callback-url - @geofencing_subscriptions_23_subscription_delete_event_validation + @geofencing_subscriptions_19_subscription_delete_event_validation Scenario: Validate that after a subscription is deleted, the subscribed events are not longer received. - Given the appropriate values are used for geofencing base-url - When the delete subscription method is triggered + Given the request body is not available and path parameter "subscriptionId" is set to the identifier of an existing subscription + When the request "deleteGeofencingSubscription" is sent Then the response code is 204 Then the get method called for checking event details on notifications-callback-url when device enters geofence Then no event received on notifications-callback-url Then the get method called for checking event details on notifications-url when device leaves geofence Then no event received on notifications-callback-url - From 9e58ca3805ec003acd957e086cc1e6fa5868b360 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Tue, 27 Aug 2024 00:42:42 +0530 Subject: [PATCH 16/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 39358680..ef81cc87 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -5,7 +5,7 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio # References to OAS spec schemas refer to schemas specified in geofencing-subscriptions.yaml, version v0.3.0 Background: Common Geofencing Subscriptions setup - Given the resource "{apiroot}/geofencing-subscriptions/v0.3/" as geofencing base-url | + Given the resource "{apiroot}/geofencing-subscriptions/v0.3/" as geofencing base-url And the header "Authorization" is set to a valid access token And the header "x-correlator" is set to a UUID value @@ -56,8 +56,8 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio And the response property "$.message" contains a user friendly text @geofencing_subscriptions_06_Get_unknown_geofencing_subscription_for_a_device - Scenario: Get geofencing subscription with invalid subscription-id which is not available - Given the request body is not available and path parameter "subscriptionId" is set to the identifier of a non-existing subscription + Scenario: Get geofencing subscription with subscription-id unknown to the system + Given the request body is not available and path parameter "subscriptionId" is set to the identifier of a uknown to subscription When the request "retrieveGeofencingSubscription" is sent Then the response code is 404 And the response property "$.status" is 404 @@ -66,7 +66,7 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio @geofencing_subscriptions_07_Delete_invalid_geofencing_subscription_for_a_device Scenario: Delete geofencing subscription with invalid parameter - Given the request body is not available and path parameter "subscriptionId" is set to the identifier of an existing non-subscription + Given the request body is not available and path parameter "subscriptionId" is set to the identifier of an non-existing subscription When the request "deleteGeofencingSubscription" is sent Then the response code is 404 And the response property "$.status" is 404 From 79513050a006b20a51b77f32148f27d7293ae672 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Tue, 27 Aug 2024 10:49:44 +0530 Subject: [PATCH 17/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 64 +++++++++--------------- 1 file changed, 25 insertions(+), 39 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index ef81cc87..6addfc0f 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -21,7 +21,7 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio @geofencing_subscriptions_02_Operation_to_retrieve_list_of_subscriptions Scenario: Get a list of subscriptions. Given the request body is not available - When the "retrieveGeofencingSubscriptionList" is sent + When the request "retrieveGeofencingSubscriptionList" 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" @@ -48,8 +48,8 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio @geofencing_subscriptions_05_Create_invalid_geofencing_subscription_for_a_device Scenario: Create geofencing subscription with invalid parameter - Given a valid subscription request body - When the request "createSubscription" is sent 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" @@ -57,7 +57,7 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio @geofencing_subscriptions_06_Get_unknown_geofencing_subscription_for_a_device Scenario: Get geofencing subscription with subscription-id unknown to the system - Given the request body is not available and path parameter "subscriptionId" is set to the identifier of a uknown to subscription + Given the request body is not available and path parameter "subscriptionId" is set to the identifier of a unknown to subscription When the request "retrieveGeofencingSubscription" is sent Then the response code is 404 And the response property "$.status" is 404 @@ -76,8 +76,8 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio @geofencing_subscriptions_08_creation_of_subscription_for_subscribed_expired_time_in_past Scenario: Subscribed expire time in past for geofencing subscription - Given a valid subscription request body - When the request "createSubscription" is sent with expire time in past + Given a valid subscription request body with expire 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" @@ -89,15 +89,14 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio Given a valid subscription request body When the create subscription with event have area-entered at "Place1" When the create subscription with event have area-entered at "Place2" and device enters "Place2" - Then the get event details on notifications-callback-url + Then event notification is received @geofencing_subscriptions_10_Get_Event-Details_of_subscription_left Scenario: Subscription creation when service have area-left event Given a valid subscription request body When the create subscription with event have area-left with at "Place1" When the create subscription with event have area-left with at "Place2" and device left "Place1" - Then they get event details from notifications-url - Then the response code is 200 + Then event notification is received And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" # The response has to comply with the generic response schema which is part of the spec @@ -115,8 +114,8 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio @geofencing_subscriptions_12_Delete_invalid_geofencing_subscription_for_a_device Scenario: Get geofencing subscription with invalid subscription-id format - Given the request body is not available and path parameter "subscriptionId" is set to the identifier of a non-existing subscription - When the request "deleteGeofencingSubscription" is sent with invalid subscription-id which is in invalid format + Given the request body is not available and path parameter "subscriptionId" is set to the identifier of a non-existing subscription which is in invalid format + When the request "deleteGeofencingSubscription" is sent Then the response code is 400 And the response property "$.status" is 400 And the response property "$.code" is "INVALID_ARGUMENT" @@ -124,9 +123,8 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio @geofencing_subscriptions_13_no_authorization_header Scenario: No Authorization header - Given the header "Authorization" is removed - And the request body is set to a valid request body - When the HTTP "POST" request is sent + Given a valid subscription request body and header "Authorization" is not available + When the request "createSubscription" is sent Then the response status code is 401 And the response property "$.status" is 401 And the response property "$.code" is "UNAUTHENTICATED" @@ -135,9 +133,8 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio @geofencing_subscriptions_14_expired_access_token Scenario: Expired access token - Given the header "Authorization" is set to an expired access token - And the request body is set to a valid request body - When the HTTP "POST" request is sent + Given a valid subscription request body and header "Authorization" is expired + When the request "createSubscription" is sent Then the response status code is 401 And the response property "$.status" is 401 And the response property "$.code" is "UNAUTHENTICATED" @@ -146,9 +143,8 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio @geofencing_subscriptions_15_invalid_access_token Scenario: Invalid access token - Given the header "Authorization" is set to an invalid access token - And the request body is set to a valid request body - When the HTTP "POST" request is sent + Given a valid subscription request body and header "Authorization" set to an invalid access token + When the request "createSubscription" is sent Then the response status code is 401 And the response header "Content-Type" is "application/json" And the response property "$.status" is 401 @@ -157,33 +153,26 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio @geofencing_subscriptions_16_sink_credentials Scenario: Validate that the subscribed events are received in the sink, with the right sinkCredential, for those situations specified in the API. - Given a valid subscription request body - When the request "createSubscription" is sent with "sink" and "sinkcredentials" + Given a valid subscription request body with "sink" and "sinkcredentials" + When the request "createSubscription" is sent Then the response code is 201 and subscription is created Then the event details are observed on notifications-url And the subscribed event received on notifications-callback-url & sink credentials are as expected @geofencing_subscriptions_17_subscriptionExpireTime Scenario: For subscriptions that provide subscriptionExpireTime, validate that the subscribed events are not longer received after the expiration time. - Given a valid subscription request body - When the request "createSubscription" is sent for less $.duration - Then the subscriptionExpireTime ]breached and subscription is expired - Then the get method called for checking event details on notifications-callback-url when device enters geofence - Then no event received on notifications-callback-url - Then the get method called for checking event details on notifications-callback-url when device leaves geofence - Then no event received on notifications-callback-url + Given a valid subscription request body and for less $.duration + When the request "createSubscription" is sent + Then the subscription is expired + And no event notifications received on callback-url when device enters or leaves geofence - @geofencing_subscriptions_18_subscriptionMaxEvents - Scenario: For subscriptions that provide subscriptionMaxEvents, validate that the subscribed events are not longer received after the maximum events limit is reached. + Scenario: For subscriptions that provide subscriptionMaxEvents, validate that the subscribed events are not longer received after the maximum events limit is reached. Given a valid subscription request body When the request "createSubscription" is sent Then the response code is 201 Then the maxevents are already triggered for available subscription - Then the get method called for checking event details on notifications-callback-url when device enters geofence - Then no event received on notifications-callback-url - Then the get method called for checking event details on notifications-url when device leaves geofence - Then no event received on notifications-callback-url + And no event notifications received on callback-url when device enters or leaves geofence @geofencing_subscriptions_19_subscription_delete_event_validation @@ -191,7 +180,4 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio Given the request body is not available and path parameter "subscriptionId" is set to the identifier of an existing subscription When the request "deleteGeofencingSubscription" is sent Then the response code is 204 - Then the get method called for checking event details on notifications-callback-url when device enters geofence - Then no event received on notifications-callback-url - Then the get method called for checking event details on notifications-url when device leaves geofence - Then no event received on notifications-callback-url + Then no event notifications received on callback-url for the device From 104e8484e4d38c15be417eb0109b164f4cccf313 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Tue, 27 Aug 2024 12:07:28 +0530 Subject: [PATCH 18/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 6addfc0f..5551a3a1 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -84,23 +84,20 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio And the response property "$.message" contains a user friendly text - @geofencing_subscriptions_09_Get_Event-Details_of_subscription_entered + @geofencing_subscriptions_09_Get_Event_Details_of_subscription_entered Scenario: Subscription creation when service have area-entered event Given a valid subscription request body - When the create subscription with event have area-entered at "Place1" - When the create subscription with event have area-entered at "Place2" and device enters "Place2" - Then event notification is received + ##Geofence should be created + When the request "createSubscription" is sent + Then the device entered to "Place2" from "Place1" + Then event notification "area-entered" is received on callback-url - @geofencing_subscriptions_10_Get_Event-Details_of_subscription_left + @geofencing_subscriptions_10_Get_Event_Details_of_subscription_left Scenario: Subscription creation when service have area-left event - Given a valid subscription request body - When the create subscription with event have area-left with at "Place1" - When the create subscription with event have area-left with at "Place2" and device left "Place1" - Then event notification is received - And the response header "Content-Type" is "application/json" - And the response header "x-correlator" has same value as the request header "x-correlator" - # The response has to comply with the generic response schema which is part of the spec - And the response body complies with the OAS schema at "/components/schemas/Subscription" + Given a valid subscription request body + When the request "createSubscription" is sent + Then the device left from "Place1" to "Place2" + Then event notification "area-left" is received on callback-url @geofencing_subscriptions_11_Get_invalid_geofencing_subscription_for_a_device From ae9e8bcb9691aaf40409c535b152120778bf4524 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Tue, 27 Aug 2024 12:14:23 +0530 Subject: [PATCH 19/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 5551a3a1..0989b4f4 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -167,7 +167,6 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio Scenario: For subscriptions that provide subscriptionMaxEvents, validate that the subscribed events are not longer received after the maximum events limit is reached. Given a valid subscription request body When the request "createSubscription" is sent - Then the response code is 201 Then the maxevents are already triggered for available subscription And no event notifications received on callback-url when device enters or leaves geofence @@ -176,5 +175,5 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio Scenario: Validate that after a subscription is deleted, the subscribed events are not longer received. Given the request body is not available and path parameter "subscriptionId" is set to the identifier of an existing subscription When the request "deleteGeofencingSubscription" is sent - Then the response code is 204 Then no event notifications received on callback-url for the device + From 62989dbd155fdb5e787634b1c50136c312acdf47 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Tue, 27 Aug 2024 19:14:47 +0530 Subject: [PATCH 20/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 0989b4f4..50835f6b 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -43,7 +43,8 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio When the request "deleteGeofencingSubscription" 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 response property $.status is 204 then response body is not available + And if 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" @geofencing_subscriptions_05_Create_invalid_geofencing_subscription_for_a_device @@ -90,7 +91,10 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio ##Geofence should be created When the request "createSubscription" is sent Then the device entered to "Place2" from "Place1" - Then event notification "area-entered" is received on callback-url + Then event notification "area-entered" is received on callback-url + And notification body complies with the OAS schema at "##/components/schemas/CloudEvent" + And type="org.camaraproject.geofencing-subscriptions.v0.area-entered" + @geofencing_subscriptions_10_Get_Event_Details_of_subscription_left Scenario: Subscription creation when service have area-left event @@ -98,6 +102,8 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio When the request "createSubscription" is sent Then the device left from "Place1" to "Place2" Then event notification "area-left" is received on callback-url + And notification body complies with the OAS schema at "##/components/schemas/CloudEvent" + And type="org.camaraproject.geofencing-subscriptions.v0.area-left" @geofencing_subscriptions_11_Get_invalid_geofencing_subscription_for_a_device @@ -110,7 +116,7 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio And the response property "$.message" contains a user friendly text @geofencing_subscriptions_12_Delete_invalid_geofencing_subscription_for_a_device - Scenario: Get geofencing subscription with invalid subscription-id format + Scenario: Get geofencing subscription with subscription-id in invalid format Given the request body is not available and path parameter "subscriptionId" is set to the identifier of a non-existing subscription which is in invalid format When the request "deleteGeofencingSubscription" is sent Then the response code is 400 @@ -161,14 +167,18 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio Given a valid subscription request body and for less $.duration When the request "createSubscription" is sent Then the subscription is expired - And no event notifications received on callback-url when device enters or leaves geofence + And The callback notification application receives subscription-ends event at provided callbackUrl + And notification body complies with the OAS schema at "##/components/schemas/CloudEvent" + And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" @geofencing_subscriptions_18_subscriptionMaxEvents Scenario: For subscriptions that provide subscriptionMaxEvents, validate that the subscribed events are not longer received after the maximum events limit is reached. Given a valid subscription request body When the request "createSubscription" is sent Then the maxevents are already triggered for available subscription - And no event notifications received on callback-url when device enters or leaves geofence + And The callback notification application receives subscription-ends event at provided callbackUrl + And notification body complies with the OAS schema at "##/components/schemas/CloudEvent" + And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends @geofencing_subscriptions_19_subscription_delete_event_validation @@ -176,4 +186,7 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio Given the request body is not available and path parameter "subscriptionId" is set to the identifier of an existing subscription When the request "deleteGeofencingSubscription" is sent Then no event notifications received on callback-url for the device + And The callback notification application receives subscription-ends event at provided callbackUrl + And notification body complies with the OAS schema at "##/components/schemas/CloudEvent" + And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" From ab8471fbe6b068855cbcf62e84f91a7d30072a95 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Wed, 28 Aug 2024 01:02:36 +0530 Subject: [PATCH 21/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 304 +++++++++++++++-------- 1 file changed, 202 insertions(+), 102 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 50835f6b..0a215075 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -1,18 +1,19 @@ @Geofencing -Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptions +Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptions # Input to be provided by the implementation to the tests # References to OAS spec schemas refer to schemas specified in geofencing-subscriptions.yaml, version v0.3.0 Background: Common Geofencing Subscriptions setup - Given the resource "{apiroot}/geofencing-subscriptions/v0.3/" as geofencing base-url + Given the resource "{apiroot}/geofencing-subscriptions/v0.3/" as geofencing base-url And the header "Authorization" is set to a valid access token And the header "x-correlator" is set to a UUID value +############################ Happy Path Scenarios######################## @geofencing_subscriptions_01_Create_geofencing_subscription_for_a_device Scenario: Create geofencing subscription Given a valid subscription request body - When the request "createSubscription" is sent + 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" @@ -36,96 +37,155 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio 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" - @geofencing_subscriptions_04_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 "deleteGeofencingSubscription" 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 response property $.status is 204 then response body is not available + 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" - - @geofencing_subscriptions_05_Create_invalid_geofencing_subscription_for_a_device + @geofencing_subscriptions_05_Receive_notification_when_device_enters_geofence + Scenario: Receive notification for area-entered event + Given a valid subscription request body + And the request body property "$.area" is set to circle which covers location "Place1" + And the request body property "$.type" is "area-entered" + When the request "createSubscription" is sent + Then the response code is 201 + Then the device entered location "Place1" + Then event notification "area-entered" is received on callback-url + And sink credentials are received as expected + And notification body complies with the OAS schema at "##/components/schemas/EventAreaEntered" + And type="org.camaraproject.geofencing-subscriptions.v0.area-entered" + + @geofencing_subscriptions_06_receive_notification_when_device_leaves_geofence + Scenario: Receive notification for area-left event + Given a valid subscription request body + And the request body property "$.area" is set to circle which covers location "Place1" + And the request body property "$.type" is "area-left" + When the request "createSubscription" is sent + Then the response code is 201 + Then the device left from location "Place1" + Then event notification "area-left" is received on callback-url + And sink credentials are received as expected + And notification body complies with the OAS schema at "##/components/schemas/EventAreaLeft" + And type="org.camaraproject.geofencing-subscriptions.v0.area-left" + + @geofencing_subscriptions_07_subscriptionExpireTime + Scenario: Receive notification for subscription-ends event on expiry + Given a valid subscription request body + And the request body property "$.area" is set to circle which covers location "Place1" + And the request body property "$.type" is "area-left" + 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" + + @geofencing_subscriptions_08_subscriptionMaxEvents + Scenario: Receive notification for subscription-ends event on max events reached + Given a valid subscription request body + And the request body property "$.area" is set to circle which covers location "Place1" + And the request body property "$.type" is "area-left" + And the request body property "$.subscriptionMaxEvents" is set to 1 + When the request "createSubscription" is sent + Then the response code is 201 + Then the device left from location "Place1" + Then event notification "area-left" 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 the response property "$.terminationReason" is "MAX_EVENTS_REACHED" + + @geofencing_subscriptions_09_subscription_delete_event_validation + Scenario: Receive notification for subscription-ends event on deletion + Given a valid subscription request body + When the request "createSubscription" is sent + Then the response code is 201 + When the request "deleteGeofencingSubscription" 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############################################ +@geofencing_subscriptions_10_create_geofencing_subscription_for_a_device_with_invalid_parameter Scenario: Create geofencing 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 + 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 - @geofencing_subscriptions_06_Get_unknown_geofencing_subscription_for_a_device - Scenario: Get geofencing subscription with subscription-id unknown to the system - Given the request body is not available and path parameter "subscriptionId" is set to the identifier of a unknown to subscription - When the request "retrieveGeofencingSubscription" is sent - Then the response code is 404 - And the response property "$.status" is 404 - And the response property "$.code" is "NOT_FOUND" - And the response property "$.message" contains a user friendly text - - @geofencing_subscriptions_07_Delete_invalid_geofencing_subscription_for_a_device - Scenario: Delete geofencing subscription with invalid parameter - Given the request body is not available and path parameter "subscriptionId" is set to the identifier of an non-existing subscription - When the request "deleteGeofencingSubscription" is sent - Then the response code is 404 - And the response property "$.status" is 404 - And the response property "$.code" is "NOT_FOUND" - And the response property "$.message" contains a user friendly text - - - @geofencing_subscriptions_08_creation_of_subscription_for_subscribed_expired_time_in_past - Scenario: Subscribed expire time in past for geofencing subscription - Given a valid subscription request body with expire time in past + @geofencing_subscriptions_11_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 + 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 - - - @geofencing_subscriptions_09_Get_Event_Details_of_subscription_entered - Scenario: Subscription creation when service have area-entered event + + + @geofencing_subscription_12_creation_with_invalid_eventType + Scenario: subscription creation with invalid event type Given a valid subscription request body - ##Geofence should be created + And the request body property "$.types" is set to invalid value When the request "createSubscription" is sent - Then the device entered to "Place2" from "Place1" - Then event notification "area-entered" is received on callback-url - And notification body complies with the OAS schema at "##/components/schemas/CloudEvent" - And type="org.camaraproject.geofencing-subscriptions.v0.area-entered" - - - @geofencing_subscriptions_10_Get_Event_Details_of_subscription_left - Scenario: Subscription creation when service have area-left event + Then the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text + + @geofencing_subscription_13_invalid_protocol + Scenario: subscription creation with invalid protocol Given a valid subscription request body When the request "createSubscription" is sent - Then the device left from "Place1" to "Place2" - Then event notification "area-left" is received on callback-url - And notification body complies with the OAS schema at "##/components/schemas/CloudEvent" - And type="org.camaraproject.geofencing-subscriptions.v0.area-left" + And "$.types"="org.camaraproject.geofencing-subscriptions.v0.area-entered" + And "$.protocol"<>"HTTP" + And "$.config.subscriptionDetail.phoneNumber" is set with with provided phoneNumber + And "$.sink" is set to provided callbackUrl + 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 - - @geofencing_subscriptions_11_Get_invalid_geofencing_subscription_for_a_device - Scenario: Get geofencing subscription with invalid subscription-id format - Given the request body is not available and path parameter "subscriptionId" is set to the identifier with invalid subscription-id which is in invalid format - When the request "retrieveGeofencingSubscription" is sent - Then the response code is 400 - And the response property "$.status" is 400 - And the response property "$.code" is "INVALID_ARGUMENT" + @geofencing_subscription_14_invalid_credential + Scenario: subscription creation with invalid credential + Given a valid subscription request body + When the request "createSubscription" is sent + And "$.types"="org.camaraproject.geofencing-subscriptions.v0.area-entered" + And "$.protocol"="HTTP" + And "$.config.subscriptionDetail.phoneNumber" is set with with provided phoneNumber + And "$.sink" is set to provided callbackUrl + And "$.sinkCredential.credentialType" <> "ACCESSTOKEN" + And "$.sinkCredential.accessTokenType" = "bearer" + And "$.sinkCredential.accessToken" is valued with a valid value + And "$.sinkCredential.accessTokenExpiresUtc" is valued with a valid value + 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 - @geofencing_subscriptions_12_Delete_invalid_geofencing_subscription_for_a_device - Scenario: Get geofencing subscription with subscription-id in invalid format - Given the request body is not available and path parameter "subscriptionId" is set to the identifier of a non-existing subscription which is in invalid format - When the request "deleteGeofencingSubscription" is sent - Then the response code is 400 - And the response property "$.status" is 400 - And the response property "$.code" is "INVALID_ARGUMENT" + @geofencing_subscription_15_invalid_token + Scenario: subscription creation with invalid token + Given a valid subscription request body + When the request "createSubscription" is sent + And "$.types"="org.camaraproject.geofencing-subscriptions.v0.area-entered" + And "$.protocol"="HTTP" + And "$.sink" is set to provided callbackUrl + And "$.sinkCredential.credentialType" = "ACCESSTOKEN" + And "$.sinkCredential.accessTokenType" <> "bearer" + And "$.sinkCredential.accessToken" is valued with a valid value + And "$.sinkCredential.accessTokenExpiresUtc" is valued with a valid value + 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 - @geofencing_subscriptions_13_no_authorization_header - Scenario: No Authorization header + @geofencing_subscriptions_16_no_authorization_header + Scenario: No Authorization header for create subscription Given a valid subscription request body and header "Authorization" is not available When the request "createSubscription" is sent Then the response status code is 401 @@ -134,8 +194,8 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio And the response property "$.message" contains a user friendly text - @geofencing_subscriptions_14_expired_access_token - Scenario: Expired access token + @geofencing_subscriptions_17_expired_access_token + Scenario: Expired access token for create subscription Given a valid subscription request body and header "Authorization" is expired When the request "createSubscription" is sent Then the response status code is 401 @@ -144,8 +204,8 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio And the response property "$.message" contains a user friendly text - @geofencing_subscriptions_15_invalid_access_token - Scenario: Invalid access token + @geofencing_subscriptions_18_invalid_access_token + Scenario: Invalid access token for create subscription Given a valid subscription request body and header "Authorization" set to an invalid access token When the request "createSubscription" is sent Then the response status code is 401 @@ -153,40 +213,80 @@ Feature: Camara Geofencing Subscriptions API ,v0.3.0 - Operations on subscriptio And the response property "$.status" is 401 And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text + + + @geofencing_subscriptions_19_no_authorization_header + Scenario: No Authorization header for get subscription + Given the request body & header "Authorization" is not available and path parameter "subscriptionId" is set to the identifier of an existing subscription + When the request "retrieveGeofencingSubscription" is sent + Then the response status 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 - @geofencing_subscriptions_16_sink_credentials - Scenario: Validate that the subscribed events are received in the sink, with the right sinkCredential, for those situations specified in the API. - Given a valid subscription request body with "sink" and "sinkcredentials" - When the request "createSubscription" is sent - Then the response code is 201 and subscription is created - Then the event details are observed on notifications-url - And the subscribed event received on notifications-callback-url & sink credentials are as expected - @geofencing_subscriptions_17_subscriptionExpireTime - Scenario: For subscriptions that provide subscriptionExpireTime, validate that the subscribed events are not longer received after the expiration time. - Given a valid subscription request body and for less $.duration - When the request "createSubscription" is sent - Then the subscription is expired - And The callback notification application receives subscription-ends event at provided callbackUrl - And notification body complies with the OAS schema at "##/components/schemas/CloudEvent" - And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" - - @geofencing_subscriptions_18_subscriptionMaxEvents - Scenario: For subscriptions that provide subscriptionMaxEvents, validate that the subscribed events are not longer received after the maximum events limit is reached. - Given a valid subscription request body - When the request "createSubscription" is sent - Then the maxevents are already triggered for available subscription - And The callback notification application receives subscription-ends event at provided callbackUrl - And notification body complies with the OAS schema at "##/components/schemas/CloudEvent" - And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends - + @geofencing_subscriptions_20_expired_access_token + Scenario: Expired access token for get subscription + Given the request body is not available and header "Authorization" is expired + When the request "retrieveGeofencingSubscription" is sent + Then the response status 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 + + + @geofencing_subscriptions_21_invalid_access_token + Scenario: Invalid access token for get subscription + Given the request body is not available and header "Authorization" set to an invalid access token + When the request "retrieveGeofencingSubscription" is sent + Then the response status code is 401 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 401 + And the response property "$.code" is "UNAUTHENTICATED" + And the response property "$.message" contains a user friendly text - @geofencing_subscriptions_19_subscription_delete_event_validation - Scenario: Validate that after a subscription is deleted, the subscribed events are not longer received. - Given the request body is not available and path parameter "subscriptionId" is set to the identifier of an existing subscription +@geofencing_subscriptions_21_no_authorization_header + Scenario: No Authorization header for delete subscription + Given a the request body and header "Authorization" is not available + When the request "deleteGeofencingSubscription" is sent + Then the response status 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 + +@geofencing_subscriptions_22_expired_access_token + Scenario: Expired access token for delete subscription + Given a valid subscription request body and header "Authorization" is expired When the request "deleteGeofencingSubscription" is sent - Then no event notifications received on callback-url for the device - And The callback notification application receives subscription-ends event at provided callbackUrl - And notification body complies with the OAS schema at "##/components/schemas/CloudEvent" - And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" - + Then the response status 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 + +@geofencing_subscriptions_23_invalid_access_token + Scenario: Invalid access token for delete subscription + Given a valid subscription request body and header "Authorization" set to an invalid access token + When the request "deleteGeofencingSubscription" is sent + Then the response status code is 401 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 401 + And the response property "$.code" is "UNAUTHENTICATED" + And the response property "$.message" contains a user friendly text + +@geofencing_subscriptions_24_get_unknown_geofencing_subscription_for_a_device + Scenario: Get geofencing subscription with subscription-id unknown to the system + Given the request body is not available and path parameter "subscriptionId" is set to the value which is unknown to system + When the request "retrieveGeofencingSubscription" is sent + Then the response code is 404 + And the response property "$.status" is 404 + And the response property "$.code" is "NOT_FOUND" + And the response property "$.message" contains a user friendly text + + @geofencing_subscriptions_25_delete_invalid_geofencing_subscription_for_a_device + Scenario: Delete geofencing subscription with invalid parameter + Given the request body is not available and path parameter "subscriptionId" is set to the identifier for an non-existing subscription + When the request "deleteGeofencingSubscription" is sent + Then the response code is 404 + And 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 e627cc9ec0ad5c8e175d6ad071ff95b8836bb30c Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Wed, 28 Aug 2024 01:07:07 +0530 Subject: [PATCH 22/43] Update code/Test_definitions/Geofencing.feature Co-authored-by: Jose Luis Urien --- code/Test_definitions/Geofencing.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 0a215075..69d603f1 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -11,7 +11,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio ############################ Happy Path Scenarios######################## @geofencing_subscriptions_01_Create_geofencing_subscription_for_a_device - Scenario: Create geofencing subscription + Scenario: Create geofencing subscription (sync creation) Given a valid subscription request body When the request "createSubscription" is sent Then the response code is 201 From 88aed7060463b3b6abd6ce61fa40c243c64166b4 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Wed, 28 Aug 2024 12:45:10 +0530 Subject: [PATCH 23/43] Update code/Test_definitions/Geofencing.feature Co-authored-by: Jose Luis Urien --- code/Test_definitions/Geofencing.feature | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 69d603f1..00ec92d6 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -12,7 +12,8 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio ############################ Happy Path Scenarios######################## @geofencing_subscriptions_01_Create_geofencing_subscription_for_a_device Scenario: Create geofencing subscription (sync creation) - Given a valid subscription request body + 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" From 65919a0bf0a3a395cb07b68fb3b7c231ca02d0b6 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Wed, 28 Aug 2024 12:45:54 +0530 Subject: [PATCH 24/43] Update code/Test_definitions/Geofencing.feature Co-authored-by: Jose Luis Urien --- code/Test_definitions/Geofencing.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 00ec92d6..d53b7200 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -116,7 +116,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio ########################### Error response scenarios############################################ @geofencing_subscriptions_10_create_geofencing_subscription_for_a_device_with_invalid_parameter Scenario: Create geofencing 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 From 7aafd8854b7d9551d27bee422a30e90bf2273234 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:43:44 +0530 Subject: [PATCH 25/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 88 +++++++++++++----------- 1 file changed, 46 insertions(+), 42 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index d53b7200..94604003 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -11,7 +11,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio ############################ Happy Path Scenarios######################## @geofencing_subscriptions_01_Create_geofencing_subscription_for_a_device - Scenario: Create geofencing subscription (sync creation) + Scenario: Create geofencing subscription (sync creation) Given that subscriptions are created synchronously And a valid subscription request body When the request "createSubscription" is sent @@ -20,8 +20,18 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio 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" - @geofencing_subscriptions_02_Operation_to_retrieve_list_of_subscriptions - Scenario: Get a list of subscriptions. + @geofencing_subscriptions_02_Create_geofencing_subscription_for_a_device + Scenario: Create geofencing subscription (async creation) + 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" + + @geofencing_subscriptions_03_Operation_to_retrieve_list_of_subscriptions + Scenario: Get a list of subscriptions. Given the request body is not available When the request "retrieveGeofencingSubscriptionList" is sent Then the response code is 200 @@ -29,8 +39,8 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio 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" - @geofencing_subscriptions_03_Operation_to_retrieve_subscription_based_on_an_existing_subscription-id - Scenario: Get a subscription based on existing subscription-id. + @geofencing_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 "retrieveGeofencingSubscription" is sent Then the response code is 200 @@ -38,8 +48,8 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio 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" - @geofencing_subscriptions_04_Operation_to_delete_subscription_based_on_an_existing_subscription-id - Scenario: Delete a subscription based on existing subscription-id. + @geofencing_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 "deleteGeofencingSubscription" is sent Then the response code is 202 or 204 @@ -47,8 +57,8 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio 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" - @geofencing_subscriptions_05_Receive_notification_when_device_enters_geofence - Scenario: Receive notification for area-entered event + @geofencing_subscriptions_06_Receive_notification_when_device_enters_geofence + Scenario: Receive notification for area-entered event Given a valid subscription request body And the request body property "$.area" is set to circle which covers location "Place1" And the request body property "$.type" is "area-entered" @@ -60,8 +70,8 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And notification body complies with the OAS schema at "##/components/schemas/EventAreaEntered" And type="org.camaraproject.geofencing-subscriptions.v0.area-entered" - @geofencing_subscriptions_06_receive_notification_when_device_leaves_geofence - Scenario: Receive notification for area-left event + @geofencing_subscriptions_07_receive_notification_when_device_leaves_geofence + Scenario: Receive notification for area-left event Given a valid subscription request body And the request body property "$.area" is set to circle which covers location "Place1" And the request body property "$.type" is "area-left" @@ -73,8 +83,8 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And notification body complies with the OAS schema at "##/components/schemas/EventAreaLeft" And type="org.camaraproject.geofencing-subscriptions.v0.area-left" - @geofencing_subscriptions_07_subscriptionExpireTime - Scenario: Receive notification for subscription-ends event on expiry + @geofencing_subscriptions_08_subscriptionExpireTime + Scenario: Receive notification for subscription-ends event on expiry Given a valid subscription request body And the request body property "$.area" is set to circle which covers location "Place1" And the request body property "$.type" is "area-left" @@ -87,7 +97,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" And the response property "$.terminationReason" is "SUBSCRIPTION_EXPIRED" - @geofencing_subscriptions_08_subscriptionMaxEvents + @geofencing_subscriptions_09_subscriptionMaxEvents Scenario: Receive notification for subscription-ends event on max events reached Given a valid subscription request body And the request body property "$.area" is set to circle which covers location "Place1" @@ -101,7 +111,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio 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" - @geofencing_subscriptions_09_subscription_delete_event_validation + @geofencing_subscriptions_10_subscription_delete_event_validation Scenario: Receive notification for subscription-ends event on deletion Given a valid subscription request body When the request "createSubscription" is sent @@ -114,7 +124,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.terminationReason" is "SUBSCRIPTION_DELETED" ########################### Error response scenarios############################################ -@geofencing_subscriptions_10_create_geofencing_subscription_for_a_device_with_invalid_parameter +@geofencing_subscriptions_11_create_geofencing_subscription_for_a_device_with_invalid_parameter Scenario: Create geofencing subscription with invalid parameter Given the request body is not compliant with the schema "/components/schemas/SubscriptionRequest" When the request "createSubscription" is sent @@ -123,7 +133,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text - @geofencing_subscriptions_11_creation_of_subscription_with_expiry_time_in_past + @geofencing_subscriptions_12_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 @@ -131,9 +141,8 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio 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 - - - @geofencing_subscription_12_creation_with_invalid_eventType + + @geofencing_subscription_13_creation_with_invalid_eventType Scenario: subscription creation with invalid event type Given a valid subscription request body And the request body property "$.types" is set to invalid value @@ -142,7 +151,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text - @geofencing_subscription_13_invalid_protocol + @geofencing_subscription_14_invalid_protocol Scenario: subscription creation with invalid protocol Given a valid subscription request body When the request "createSubscription" is sent @@ -154,7 +163,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "INVALID_PROTOCOL" And the response property "$.message" contains a user friendly text - @geofencing_subscription_14_invalid_credential + @geofencing_subscription_15_invalid_credential Scenario: subscription creation with invalid credential Given a valid subscription request body When the request "createSubscription" is sent @@ -170,7 +179,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "INVALID_CREDENTIAL" And the response property "$.message" contains a user friendly text - @geofencing_subscription_15_invalid_token + @geofencing_subscription_16_invalid_token Scenario: subscription creation with invalid token Given a valid subscription request body When the request "createSubscription" is sent @@ -185,7 +194,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "INVALID_TOKEN" And the response property "$.message" contains a user friendly text - @geofencing_subscriptions_16_no_authorization_header + @geofencing_subscriptions_17_no_authorization_header Scenario: No Authorization header for create subscription Given a valid subscription request body and header "Authorization" is not available When the request "createSubscription" is sent @@ -194,8 +203,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - - @geofencing_subscriptions_17_expired_access_token + @geofencing_subscriptions_18_expired_access_token Scenario: Expired access token for create subscription Given a valid subscription request body and header "Authorization" is expired When the request "createSubscription" is sent @@ -204,8 +212,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - - @geofencing_subscriptions_18_invalid_access_token + @geofencing_subscriptions_19_invalid_access_token Scenario: Invalid access token for create subscription Given a valid subscription request body and header "Authorization" set to an invalid access token When the request "createSubscription" is sent @@ -214,9 +221,8 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.status" is 401 And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - - - @geofencing_subscriptions_19_no_authorization_header + +@geofencing_subscriptions_20_no_authorization_header Scenario: No Authorization header for get subscription Given the request body & header "Authorization" is not available and path parameter "subscriptionId" is set to the identifier of an existing subscription When the request "retrieveGeofencingSubscription" is sent @@ -225,8 +231,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - - @geofencing_subscriptions_20_expired_access_token +@geofencing_subscriptions_21_expired_access_token Scenario: Expired access token for get subscription Given the request body is not available and header "Authorization" is expired When the request "retrieveGeofencingSubscription" is sent @@ -234,9 +239,8 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.status" is 401 And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - - - @geofencing_subscriptions_21_invalid_access_token + +@geofencing_subscriptions_22_invalid_access_token Scenario: Invalid access token for get subscription Given the request body is not available and header "Authorization" set to an invalid access token When the request "retrieveGeofencingSubscription" is sent @@ -245,8 +249,8 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.status" is 401 And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - -@geofencing_subscriptions_21_no_authorization_header + +@geofencing_subscriptions_23_no_authorization_header Scenario: No Authorization header for delete subscription Given a the request body and header "Authorization" is not available When the request "deleteGeofencingSubscription" is sent @@ -255,7 +259,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text -@geofencing_subscriptions_22_expired_access_token +@geofencing_subscriptions_24_expired_access_token Scenario: Expired access token for delete subscription Given a valid subscription request body and header "Authorization" is expired When the request "deleteGeofencingSubscription" is sent @@ -264,7 +268,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text -@geofencing_subscriptions_23_invalid_access_token +@geofencing_subscriptions_25_invalid_access_token Scenario: Invalid access token for delete subscription Given a valid subscription request body and header "Authorization" set to an invalid access token When the request "deleteGeofencingSubscription" is sent @@ -274,7 +278,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text -@geofencing_subscriptions_24_get_unknown_geofencing_subscription_for_a_device +@geofencing_subscriptions_26_get_unknown_geofencing_subscription_for_a_device Scenario: Get geofencing subscription with subscription-id unknown to the system Given the request body is not available and path parameter "subscriptionId" is set to the value which is unknown to system When the request "retrieveGeofencingSubscription" is sent @@ -283,7 +287,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "NOT_FOUND" And the response property "$.message" contains a user friendly text - @geofencing_subscriptions_25_delete_invalid_geofencing_subscription_for_a_device + @geofencing_subscriptions_27_delete_invalid_geofencing_subscription_for_a_device Scenario: Delete geofencing subscription with invalid parameter Given the request body is not available and path parameter "subscriptionId" is set to the identifier for an non-existing subscription When the request "deleteGeofencingSubscription" is sent From fc4b4808c884b01d58a54690234546c9f301733d Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Wed, 28 Aug 2024 14:55:19 +0530 Subject: [PATCH 26/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 94604003..c5111fa6 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -143,7 +143,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.message" contains a user friendly text @geofencing_subscription_13_creation_with_invalid_eventType - Scenario: subscription creation with invalid event type + Scenario: Subscription creation with invalid event type Given a valid subscription request body And the request body property "$.types" is set to invalid value When the request "createSubscription" is sent @@ -152,7 +152,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.message" contains a user friendly text @geofencing_subscription_14_invalid_protocol - Scenario: subscription creation with invalid protocol + Scenario: Subscription creation with invalid protocol Given a valid subscription request body When the request "createSubscription" is sent And "$.types"="org.camaraproject.geofencing-subscriptions.v0.area-entered" @@ -164,7 +164,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.message" contains a user friendly text @geofencing_subscription_15_invalid_credential - Scenario: subscription creation with invalid credential + Scenario: Subscription creation with invalid credential Given a valid subscription request body When the request "createSubscription" is sent And "$.types"="org.camaraproject.geofencing-subscriptions.v0.area-entered" @@ -180,7 +180,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.message" contains a user friendly text @geofencing_subscription_16_invalid_token - Scenario: subscription creation with invalid token + Scenario: Subscription creation with invalid token Given a valid subscription request body When the request "createSubscription" is sent And "$.types"="org.camaraproject.geofencing-subscriptions.v0.area-entered" @@ -279,7 +279,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.message" contains a user friendly text @geofencing_subscriptions_26_get_unknown_geofencing_subscription_for_a_device - Scenario: Get geofencing subscription with subscription-id unknown to the system + Scenario: Get method for geofencing subscription with subscription-id unknown to the system Given the request body is not available and path parameter "subscriptionId" is set to the value which is unknown to system When the request "retrieveGeofencingSubscription" is sent Then the response code is 404 @@ -288,7 +288,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.message" contains a user friendly text @geofencing_subscriptions_27_delete_invalid_geofencing_subscription_for_a_device - Scenario: Delete geofencing subscription with invalid parameter + Scenario: Delete geofencing subscription with unknown subscription-id to the system Given the request body is not available and path parameter "subscriptionId" is set to the identifier for an non-existing subscription When the request "deleteGeofencingSubscription" is sent Then the response code is 404 From ba1783940bcbaf2f890fc9880554dc3e77657430 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 00:29:02 +0530 Subject: [PATCH 27/43] Update code/Test_definitions/Geofencing.feature Co-authored-by: Jose Luis Urien --- code/Test_definitions/Geofencing.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index c5111fa6..da87828b 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -9,7 +9,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the header "Authorization" is set to a valid access token And the header "x-correlator" is set to a UUID value -############################ Happy Path Scenarios######################## +############################ Happy Path Scenarios ######################## @geofencing_subscriptions_01_Create_geofencing_subscription_for_a_device Scenario: Create geofencing subscription (sync creation) Given that subscriptions are created synchronously From b9fd8c9af24e9e13dfa7e7de617d6a2544a538df Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 00:29:22 +0530 Subject: [PATCH 28/43] Update code/Test_definitions/Geofencing.feature Co-authored-by: Jose Luis Urien --- code/Test_definitions/Geofencing.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index da87828b..4a6b74a9 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -10,7 +10,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the header "x-correlator" is set to a UUID value ############################ Happy Path Scenarios ######################## - @geofencing_subscriptions_01_Create_geofencing_subscription_for_a_device + @geofencing_subscriptions_01_Create_geofencing_subscription_for_a_device_sync Scenario: Create geofencing subscription (sync creation) Given that subscriptions are created synchronously And a valid subscription request body From a2893a64b5ea7b9c1dcec2a80cbe47ec75df5ebb Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 00:29:38 +0530 Subject: [PATCH 29/43] Update code/Test_definitions/Geofencing.feature Co-authored-by: Jose Luis Urien --- code/Test_definitions/Geofencing.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 4a6b74a9..cdc220d3 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -20,7 +20,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio 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" - @geofencing_subscriptions_02_Create_geofencing_subscription_for_a_device + @geofencing_subscriptions_02_Create_geofencing_subscription_for_a_device_async Scenario: Create geofencing subscription (async creation) Given that subscriptions are created asynchronously And a valid subscription request body From 188c49c0c708dc4c11f42ff4a57308d41f555f87 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 00:32:19 +0530 Subject: [PATCH 30/43] Update code/Test_definitions/Geofencing.feature Co-authored-by: Jose Luis Urien --- code/Test_definitions/Geofencing.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index cdc220d3..0bf0976b 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -88,7 +88,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio Given a valid subscription request body And the request body property "$.area" is set to circle which covers location "Place1" And the request body property "$.type" is "area-left" - 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 From 38f1660594c23a7be9e5b7fa239bdde137e0bd96 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 00:48:12 +0530 Subject: [PATCH 31/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 0bf0976b..99708f1d 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -289,7 +289,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio @geofencing_subscriptions_27_delete_invalid_geofencing_subscription_for_a_device Scenario: Delete geofencing subscription with unknown subscription-id to the system - Given the request body is not available and path parameter "subscriptionId" is set to the identifier for an non-existing subscription + Given the request body is not available and path parameter "subscriptionId" is set to the value which is unknown to system When the request "deleteGeofencingSubscription" is sent Then the response code is 404 And the response property "$.status" is 404 From 9fcd8f10f45150a39e4223297066e2932198b78a Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 00:58:04 +0530 Subject: [PATCH 32/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 99708f1d..6cf68a76 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -116,6 +116,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio Given a valid subscription request body When the request "createSubscription" is sent Then the response code is 201 + And When the request "deleteGeofencingSubscription" is sent Then the response code is 202 or 204 Then event notification "subscription-ends" is received on callback-url @@ -123,7 +124,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" And the response property "$.terminationReason" is "SUBSCRIPTION_DELETED" -########################### Error response scenarios############################################ +########################### Error response scenarios ############################################ @geofencing_subscriptions_11_create_geofencing_subscription_for_a_device_with_invalid_parameter Scenario: Create geofencing subscription with invalid parameter Given the request body is not compliant with the schema "/components/schemas/SubscriptionRequest" @@ -288,7 +289,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.message" contains a user friendly text @geofencing_subscriptions_27_delete_invalid_geofencing_subscription_for_a_device - Scenario: Delete geofencing subscription with unknown subscription-id to the system + Scenario: Delete geofencing subscription with subscription-id unknown to the system Given the request body is not available and path parameter "subscriptionId" is set to the value which is unknown to system When the request "deleteGeofencingSubscription" is sent Then the response code is 404 From 7d91a4a8974dda258d62e791773943dbc822ef32 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 01:58:35 +0530 Subject: [PATCH 33/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 79 ++++++++++++------------ 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 6cf68a76..aa20c818 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -83,7 +83,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And notification body complies with the OAS schema at "##/components/schemas/EventAreaLeft" And type="org.camaraproject.geofencing-subscriptions.v0.area-left" - @geofencing_subscriptions_08_subscriptionExpireTime + @geofencing_subscriptions_08_subscription_ends_on_expiry Scenario: Receive notification for subscription-ends event on expiry Given a valid subscription request body And the request body property "$.area" is set to circle which covers location "Place1" @@ -97,7 +97,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" And the response property "$.terminationReason" is "SUBSCRIPTION_EXPIRED" - @geofencing_subscriptions_09_subscriptionMaxEvents + @geofencing_subscriptions_09_subscription_ends_on_max_events Scenario: Receive notification for subscription-ends event on max events reached Given a valid subscription request body And the request body property "$.area" is set to circle which covers location "Place1" @@ -116,7 +116,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio Given a valid subscription request body When the request "createSubscription" is sent Then the response code is 201 - And + And path parameter "subscriptionId" is set to the identifier of an existing subscription created When the request "deleteGeofencingSubscription" is sent Then the response code is 202 or 204 Then event notification "subscription-ends" is received on callback-url @@ -136,8 +136,9 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio @geofencing_subscriptions_12_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 + 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" @@ -156,10 +157,10 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio Scenario: Subscription creation with invalid protocol Given a valid subscription request body When the request "createSubscription" is sent - And "$.types"="org.camaraproject.geofencing-subscriptions.v0.area-entered" - And "$.protocol"<>"HTTP" - And "$.config.subscriptionDetail.phoneNumber" is set with with provided phoneNumber - And "$.sink" is set to provided callbackUrl + And the request property "$.types" is set to "org.camaraproject.geofencing-subscriptions.v0.area-entered" + And the request property "$.protocol" is not set to "HTTP" + And the request property "$.config.subscriptionDetail.phoneNumber" is set with provided phoneNumber + And the request property "$.sink" is set to provided callbackUrl 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 @@ -168,14 +169,14 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio Scenario: Subscription creation with invalid credential Given a valid subscription request body When the request "createSubscription" is sent - And "$.types"="org.camaraproject.geofencing-subscriptions.v0.area-entered" - And "$.protocol"="HTTP" - And "$.config.subscriptionDetail.phoneNumber" is set with with provided phoneNumber - And "$.sink" is set to provided callbackUrl - And "$.sinkCredential.credentialType" <> "ACCESSTOKEN" - And "$.sinkCredential.accessTokenType" = "bearer" - And "$.sinkCredential.accessToken" is valued with a valid value - And "$.sinkCredential.accessTokenExpiresUtc" is valued with a valid value + And the request property "$.types" is set to "org.camaraproject.geofencing-subscriptions.v0.area-entered" + And the request property "$.protocol" is set to "HTTP" + And the request property "$.config.subscriptionDetail.phoneNumber" is set with with provided phoneNumber + And the request property "$.sink" is set to provided callbackUrl + And the request property "$.sinkCredential.credentialType" is not set to "ACCESSTOKEN" + And the request property "$.sinkCredential.accessTokenType" is set to "bearer" + And the request property "$.sinkCredential.accessToken" is valued with a valid value + And the request property "$.sinkCredential.accessTokenExpiresUtc" is valued with a valid value 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 @@ -184,55 +185,55 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio Scenario: Subscription creation with invalid token Given a valid subscription request body When the request "createSubscription" is sent - And "$.types"="org.camaraproject.geofencing-subscriptions.v0.area-entered" - And "$.protocol"="HTTP" - And "$.sink" is set to provided callbackUrl - And "$.sinkCredential.credentialType" = "ACCESSTOKEN" - And "$.sinkCredential.accessTokenType" <> "bearer" - And "$.sinkCredential.accessToken" is valued with a valid value - And "$.sinkCredential.accessTokenExpiresUtc" is valued with a valid value + And the request property "$.types"="org.camaraproject.geofencing-subscriptions.v0.area-entered" + And the request property "$.protocol" is set to "HTTP" + And the request property "$.sink" is set to provided callbackUrl + And the request property "$.sinkCredential.credentialType" is set to "ACCESSTOKEN" + And the request property "$.sinkCredential.accessTokenType" is not set to "bearer" + And the request property "$.sinkCredential.accessToken" is valued with a valid value + And the request property "$.sinkCredential.accessTokenExpiresUtc" is valued with a valid value 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 - @geofencing_subscriptions_17_no_authorization_header + @geofencing_subscriptions_17_no_authorization_header_for_create_subscription Scenario: No Authorization header for create subscription Given a valid subscription request body and header "Authorization" is not available - When the request "createSubscription" is sent + When the request "createSubscription" is sent Then the response status 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 - @geofencing_subscriptions_18_expired_access_token + @geofencing_subscriptions_18_expired_access_token_for_create_subscription Scenario: Expired access token for create subscription Given a valid subscription request body and header "Authorization" is expired - When the request "createSubscription" is sent + When the request "createSubscription" is sent Then the response status 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 - @geofencing_subscriptions_19_invalid_access_token + @geofencing_subscriptions_19_invalid_access_token_for_create_subscription Scenario: Invalid access token for create subscription Given a valid subscription request body and header "Authorization" set to an invalid access token - When the request "createSubscription" is sent + When the request "createSubscription" is sent Then the response status code is 401 And the response header "Content-Type" is "application/json" And the response property "$.status" is 401 And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text -@geofencing_subscriptions_20_no_authorization_header +@geofencing_subscriptions_20_no_authorization_header_for_get_subscription Scenario: No Authorization header for get subscription Given the request body & header "Authorization" is not available and path parameter "subscriptionId" is set to the identifier of an existing subscription - When the request "retrieveGeofencingSubscription" is sent + When the request "retrieveGeofencingSubscription" is sent Then the response status 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 -@geofencing_subscriptions_21_expired_access_token +@geofencing_subscriptions_21_expired_access_token_for_get_subscription Scenario: Expired access token for get subscription Given the request body is not available and header "Authorization" is expired When the request "retrieveGeofencingSubscription" is sent @@ -241,7 +242,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text -@geofencing_subscriptions_22_invalid_access_token +@geofencing_subscriptions_22_invalid_access_token_for_get_subscription Scenario: Invalid access token for get subscription Given the request body is not available and header "Authorization" set to an invalid access token When the request "retrieveGeofencingSubscription" is sent @@ -251,7 +252,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text -@geofencing_subscriptions_23_no_authorization_header +@geofencing_subscriptions_23_no_authorization_header_for_delete_subscription Scenario: No Authorization header for delete subscription Given a the request body and header "Authorization" is not available When the request "deleteGeofencingSubscription" is sent @@ -260,7 +261,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text -@geofencing_subscriptions_24_expired_access_token +@geofencing_subscriptions_24_expired_access_token_for_delete_subscription Scenario: Expired access token for delete subscription Given a valid subscription request body and header "Authorization" is expired When the request "deleteGeofencingSubscription" is sent @@ -269,7 +270,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text -@geofencing_subscriptions_25_invalid_access_token +@geofencing_subscriptions_25_invalid_access_token_for_delete_subscription Scenario: Invalid access token for delete subscription Given a valid subscription request body and header "Authorization" set to an invalid access token When the request "deleteGeofencingSubscription" is sent @@ -281,7 +282,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio @geofencing_subscriptions_26_get_unknown_geofencing_subscription_for_a_device Scenario: Get method for geofencing subscription with subscription-id unknown to the system - Given the request body is not available and path parameter "subscriptionId" is set to the value which is unknown to system + Given the request body is not available and path parameter "subscriptionId" is set to the value unknown to system When the request "retrieveGeofencingSubscription" is sent Then the response code is 404 And the response property "$.status" is 404 @@ -290,7 +291,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio @geofencing_subscriptions_27_delete_invalid_geofencing_subscription_for_a_device Scenario: Delete geofencing subscription with subscription-id unknown to the system - Given the request body is not available and path parameter "subscriptionId" is set to the value which is unknown to system + Given the request body is not available and path parameter "subscriptionId" is set to the value unknown to system When the request "deleteGeofencingSubscription" is sent Then the response code is 404 And the response property "$.status" is 404 From f26f8455524fe2f445c1198ef8a56ac3850e445c Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 16:24:12 +0530 Subject: [PATCH 34/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 66 ++++++++++++++---------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index aa20c818..0560540d 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -30,16 +30,25 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio 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" - @geofencing_subscriptions_03_Operation_to_retrieve_list_of_subscriptions - Scenario: Get a list of subscriptions. - Given the request body is not available + @geofencing_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 "retrieveGeofencingSubscriptionList" 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" - @geofencing_subscriptions_04_Operation_to_retrieve_subscription_based_on_an_existing_subscription-id + @geofencing_subscriptions_04_Operation_to_retrieve_list_of_subscriptions + Scenario: Get a list of subscriptions + Given a client with subscriptions created + When the request "retrieveGeofencingSubscriptionList" 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 itenms and complies with the OAS schema at "/components/schemas/Subscription" + + @geofencing_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 When the request "retrieveGeofencingSubscription" is sent @@ -48,7 +57,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio 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" - @geofencing_subscriptions_05_Operation_to_delete_subscription_based_on_an_existing_subscription-id + @geofencing_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 When the request "deleteGeofencingSubscription" is sent @@ -57,7 +66,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio 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" - @geofencing_subscriptions_06_Receive_notification_when_device_enters_geofence + @geofencing_subscriptions_07_Receive_notification_when_device_enters_geofence Scenario: Receive notification for area-entered event Given a valid subscription request body And the request body property "$.area" is set to circle which covers location "Place1" @@ -70,7 +79,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And notification body complies with the OAS schema at "##/components/schemas/EventAreaEntered" And type="org.camaraproject.geofencing-subscriptions.v0.area-entered" - @geofencing_subscriptions_07_receive_notification_when_device_leaves_geofence + @geofencing_subscriptions_08_receive_notification_when_device_leaves_geofence Scenario: Receive notification for area-left event Given a valid subscription request body And the request body property "$.area" is set to circle which covers location "Place1" @@ -83,7 +92,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And notification body complies with the OAS schema at "##/components/schemas/EventAreaLeft" And type="org.camaraproject.geofencing-subscriptions.v0.area-left" - @geofencing_subscriptions_08_subscription_ends_on_expiry + @geofencing_subscriptions_09_subscription_ends_on_expiry Scenario: Receive notification for subscription-ends event on expiry Given a valid subscription request body And the request body property "$.area" is set to circle which covers location "Place1" @@ -97,7 +106,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ends" And the response property "$.terminationReason" is "SUBSCRIPTION_EXPIRED" - @geofencing_subscriptions_09_subscription_ends_on_max_events + @geofencing_subscriptions_10_subscription_ends_on_max_events Scenario: Receive notification for subscription-ends event on max events reached Given a valid subscription request body And the request body property "$.area" is set to circle which covers location "Place1" @@ -111,7 +120,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio 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" - @geofencing_subscriptions_10_subscription_delete_event_validation + @geofencing_subscriptions_11_subscription_delete_event_validation Scenario: Receive notification for subscription-ends event on deletion Given a valid subscription request body When the request "createSubscription" is sent @@ -125,7 +134,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.terminationReason" is "SUBSCRIPTION_DELETED" ########################### Error response scenarios ############################################ -@geofencing_subscriptions_11_create_geofencing_subscription_for_a_device_with_invalid_parameter +@geofencing_subscriptions_12_create_geofencing_subscription_for_a_device_with_invalid_parameter Scenario: Create geofencing subscription with invalid parameter Given the request body is not compliant with the schema "/components/schemas/SubscriptionRequest" When the request "createSubscription" is sent @@ -134,7 +143,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text - @geofencing_subscriptions_12_creation_of_subscription_with_expiry_time_in_past + @geofencing_subscriptions_13_creation_of_subscription_with_expiry_time_in_past Scenario: Expiry time in past Given a valid subscription request body And request body property "$.subscriptionexpiretime" in past @@ -144,7 +153,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text - @geofencing_subscription_13_creation_with_invalid_eventType + @geofencing_subscription_14_creation_with_invalid_eventType Scenario: Subscription creation with invalid event type Given a valid subscription request body And the request body property "$.types" is set to invalid value @@ -153,7 +162,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text - @geofencing_subscription_14_invalid_protocol + @geofencing_subscription_15_invalid_protocol Scenario: Subscription creation with invalid protocol Given a valid subscription request body When the request "createSubscription" is sent @@ -165,7 +174,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "INVALID_PROTOCOL" And the response property "$.message" contains a user friendly text - @geofencing_subscription_15_invalid_credential + @geofencing_subscription_16_invalid_credential Scenario: Subscription creation with invalid credential Given a valid subscription request body When the request "createSubscription" is sent @@ -181,7 +190,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "INVALID_CREDENTIAL" And the response property "$.message" contains a user friendly text - @geofencing_subscription_16_invalid_token + @geofencing_subscription_17_invalid_token Scenario: Subscription creation with invalid token Given a valid subscription request body When the request "createSubscription" is sent @@ -193,19 +202,19 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the request property "$.sinkCredential.accessToken" is valued with a valid value And the request property "$.sinkCredential.accessTokenExpiresUtc" is valued with a valid value 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 - @geofencing_subscriptions_17_no_authorization_header_for_create_subscription + @geofencing_subscriptions_18_no_authorization_header_for_create_subscription Scenario: No Authorization header for create subscription - Given a valid subscription request body and header "Authorization" is not available + Given a valid subscription request body and header "Authorization" is not set to When the request "createSubscription" is sent Then the response status 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 - @geofencing_subscriptions_18_expired_access_token_for_create_subscription + @geofencing_subscriptions_19_expired_access_token_for_create_subscription Scenario: Expired access token for create subscription Given a valid subscription request body and header "Authorization" is expired When the request "createSubscription" is sent @@ -214,7 +223,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - @geofencing_subscriptions_19_invalid_access_token_for_create_subscription + @geofencing_subscriptions_20_invalid_access_token_for_create_subscription Scenario: Invalid access token for create subscription Given a valid subscription request body and header "Authorization" set to an invalid access token When the request "createSubscription" is sent @@ -224,25 +233,26 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text -@geofencing_subscriptions_20_no_authorization_header_for_get_subscription +@geofencing_subscriptions_21_no_authorization_header_for_get_subscription Scenario: No Authorization header for get subscription - Given the request body & header "Authorization" is not available and path parameter "subscriptionId" is set to the identifier of an existing subscription + Given the request body & header "Authorization" is not set to valid token + And path parameter "subscriptionId" is set to the identifier of an existing subscription When the request "retrieveGeofencingSubscription" is sent Then the response status 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 -@geofencing_subscriptions_21_expired_access_token_for_get_subscription +@geofencing_subscriptions_22_expired_access_token_for_get_subscription Scenario: Expired access token for get subscription - Given the request body is not available and header "Authorization" is expired + Given the request body is not available and header "Authorization" is set to expired token When the request "retrieveGeofencingSubscription" is sent Then the response status 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 -@geofencing_subscriptions_22_invalid_access_token_for_get_subscription +@geofencing_subscriptions_23_invalid_access_token_for_get_subscription Scenario: Invalid access token for get subscription Given the request body is not available and header "Authorization" set to an invalid access token When the request "retrieveGeofencingSubscription" is sent @@ -254,7 +264,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio @geofencing_subscriptions_23_no_authorization_header_for_delete_subscription Scenario: No Authorization header for delete subscription - Given a the request body and header "Authorization" is not available + Given a the request body and header "Authorization" is set without a token When the request "deleteGeofencingSubscription" is sent Then the response status code is 401 And the response property "$.status" is 401 @@ -263,7 +273,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio @geofencing_subscriptions_24_expired_access_token_for_delete_subscription Scenario: Expired access token for delete subscription - Given a valid subscription request body and header "Authorization" is expired + Given a valid subscription request body and header "Authorization" is set with an expired token When the request "deleteGeofencingSubscription" is sent Then the response status code is 401 And the response property "$.status" is 401 From 888f6ba80db14eba793317e42f596b27c3d1468b Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:05:23 +0530 Subject: [PATCH 35/43] Update code/Test_definitions/Geofencing.feature Co-authored-by: Jose Luis Urien --- code/Test_definitions/Geofencing.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 0560540d..d83b2ae6 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -46,7 +46,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio 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 itenms and 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" @geofencing_subscriptions_05_Operation_to_retrieve_subscription_based_on_an_existing_subscription-id Scenario: Get a subscription based on existing subscription-id. From 05186ee9a3ec52a820b576865fe3fcbaa074bf59 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:06:29 +0530 Subject: [PATCH 36/43] Update code/Test_definitions/Geofencing.feature Co-authored-by: Jose Luis Urien --- code/Test_definitions/Geofencing.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index d83b2ae6..88006e4a 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -37,7 +37,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio 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 @geofencing_subscriptions_04_Operation_to_retrieve_list_of_subscriptions Scenario: Get a list of subscriptions From 91eb45e3964a7d7c075d86e4051ad99d1339ab4c Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:08:15 +0530 Subject: [PATCH 37/43] Update code/Test_definitions/Geofencing.feature Co-authored-by: Jose Luis Urien --- code/Test_definitions/Geofencing.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 88006e4a..c4e83e7f 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -50,7 +50,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio @geofencing_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 "retrieveGeofencingSubscription" is sent Then the response code is 200 And the response header "Content-Type" is "application/json" From cde7ad63610e8f32a3581746e5aedbcc4ac58d08 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:08:25 +0530 Subject: [PATCH 38/43] Update code/Test_definitions/Geofencing.feature Co-authored-by: Jose Luis Urien --- code/Test_definitions/Geofencing.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index c4e83e7f..358453be 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -59,7 +59,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio @geofencing_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 "deleteGeofencingSubscription" 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" From c449069debd36c02447f662b64ed0440a0cc5746 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:09:27 +0530 Subject: [PATCH 39/43] Update code/Test_definitions/Geofencing.feature Co-authored-by: Jose Luis Urien --- code/Test_definitions/Geofencing.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 358453be..2a537ca4 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -245,7 +245,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio @geofencing_subscriptions_22_expired_access_token_for_get_subscription Scenario: Expired access token for get subscription - Given the request body is not available and header "Authorization" is set to expired token + Given the header "Authorization" is set to expired token When the request "retrieveGeofencingSubscription" is sent Then the response status code is 401 And the response property "$.status" is 401 From 2e1fbae5e747b7ddb5d594e83fab2aa336030f83 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:09:54 +0530 Subject: [PATCH 40/43] Update code/Test_definitions/Geofencing.feature Co-authored-by: Jose Luis Urien --- code/Test_definitions/Geofencing.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 2a537ca4..580e0aa6 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -254,7 +254,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio @geofencing_subscriptions_23_invalid_access_token_for_get_subscription Scenario: Invalid access token for get subscription - Given the request body is not available and header "Authorization" set to an invalid access token + Given the header "Authorization" set to an invalid access token When the request "retrieveGeofencingSubscription" is sent Then the response status code is 401 And the response header "Content-Type" is "application/json" From 2b337f71b3daef7d986ede2293cfd3043a97a250 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:10:17 +0530 Subject: [PATCH 41/43] Update code/Test_definitions/Geofencing.feature Co-authored-by: Jose Luis Urien --- code/Test_definitions/Geofencing.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index 580e0aa6..e554f823 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -292,7 +292,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio @geofencing_subscriptions_26_get_unknown_geofencing_subscription_for_a_device Scenario: Get method for geofencing subscription with subscription-id unknown to the system - Given the request body is not available and path parameter "subscriptionId" is set to the value unknown to system + Given the path parameter "subscriptionId" is set to the value unknown to system When the request "retrieveGeofencingSubscription" is sent Then the response code is 404 And the response property "$.status" is 404 From 70564533986aa883010fd820cd9f22cda143e594 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:10:26 +0530 Subject: [PATCH 42/43] Update code/Test_definitions/Geofencing.feature Co-authored-by: Jose Luis Urien --- code/Test_definitions/Geofencing.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index e554f823..d47bffca 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -301,7 +301,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio @geofencing_subscriptions_27_delete_invalid_geofencing_subscription_for_a_device Scenario: Delete geofencing subscription with subscription-id unknown to the system - Given the request body is not available and path parameter "subscriptionId" is set to the value unknown to system + Given the path parameter "subscriptionId" is set to the value unknown to system When the request "deleteGeofencingSubscription" is sent Then the response code is 404 And the response property "$.status" is 404 From bfe30d15e642bebf8e26d032b2954394e035fe91 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 17:15:12 +0530 Subject: [PATCH 43/43] Update Geofencing.feature --- code/Test_definitions/Geofencing.feature | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/code/Test_definitions/Geofencing.feature b/code/Test_definitions/Geofencing.feature index d47bffca..66c6cc4f 100644 --- a/code/Test_definitions/Geofencing.feature +++ b/code/Test_definitions/Geofencing.feature @@ -225,7 +225,8 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio @geofencing_subscriptions_20_invalid_access_token_for_create_subscription Scenario: Invalid access token for create subscription - Given a valid subscription request body and header "Authorization" set to an invalid access token + Given a valid subscription request body + And header "Authorization" set to an invalid access token When the request "createSubscription" is sent Then the response status code is 401 And the response header "Content-Type" is "application/json" @@ -235,7 +236,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio @geofencing_subscriptions_21_no_authorization_header_for_get_subscription Scenario: No Authorization header for get subscription - Given the request body & header "Authorization" is not set to valid token + Given header "Authorization" is not set to valid token And path parameter "subscriptionId" is set to the identifier of an existing subscription When the request "retrieveGeofencingSubscription" is sent Then the response status code is 401 @@ -264,7 +265,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio @geofencing_subscriptions_23_no_authorization_header_for_delete_subscription Scenario: No Authorization header for delete subscription - Given a the request body and header "Authorization" is set without a token + Given header "Authorization" is set without a token When the request "deleteGeofencingSubscription" is sent Then the response status code is 401 And the response property "$.status" is 401 @@ -273,7 +274,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio @geofencing_subscriptions_24_expired_access_token_for_delete_subscription Scenario: Expired access token for delete subscription - Given a valid subscription request body and header "Authorization" is set with an expired token + Given header "Authorization" is set with an expired token When the request "deleteGeofencingSubscription" is sent Then the response status code is 401 And the response property "$.status" is 401 @@ -282,7 +283,7 @@ Feature: Camara Geofencing Subscriptions API, v0.3.0 - Operations on subscriptio @geofencing_subscriptions_25_invalid_access_token_for_delete_subscription Scenario: Invalid access token for delete subscription - Given a valid subscription request body and header "Authorization" set to an invalid access token + Given header "Authorization" set to an invalid access token When the request "deleteGeofencingSubscription" is sent Then the response status code is 401 And the response header "Content-Type" is "application/json"