Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geofencing feature file #181

Merged
merged 44 commits into from
Aug 30, 2024
Merged
Changes from 11 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
ddfc1d4
Geofencing feature file
mdomale Apr 8, 2024
95bd04b
Update Geofencing.feature
mdomale Apr 15, 2024
bb2df50
Update Geofencing.feature
mdomale Jul 19, 2024
a5221b1
Update Geofencing.feature
mdomale Jul 19, 2024
296c111
Update Geofencing.feature
mdomale Jul 19, 2024
7507571
Merge branch 'camaraproject:main' into Feature-file-Geofencing
mdomale Aug 12, 2024
7b39f8a
Update Geofencing.feature
mdomale Aug 12, 2024
de6e32c
Update Geofencing.feature
mdomale Aug 12, 2024
a3d58ba
Update Geofencing.feature
mdomale Aug 12, 2024
b806c65
Update Geofencing.feature
mdomale Aug 12, 2024
422ca3c
Update Geofencing.feature
mdomale Aug 12, 2024
0a37af2
Update code/Test_definitions/Geofencing.feature
mdomale Aug 23, 2024
368ac66
Update code/Test_definitions/Geofencing.feature
mdomale Aug 23, 2024
ce8b897
Update Geofencing.feature
mdomale Aug 26, 2024
36ccd72
Update Geofencing.feature
mdomale Aug 26, 2024
e1faaac
Update Geofencing.feature
mdomale Aug 26, 2024
9e58ca3
Update Geofencing.feature
mdomale Aug 26, 2024
7951305
Update Geofencing.feature
mdomale Aug 27, 2024
104e848
Update Geofencing.feature
mdomale Aug 27, 2024
ae9e8bc
Update Geofencing.feature
mdomale Aug 27, 2024
62989db
Update Geofencing.feature
mdomale Aug 27, 2024
ab8471f
Update Geofencing.feature
mdomale Aug 27, 2024
e627cc9
Update code/Test_definitions/Geofencing.feature
mdomale Aug 27, 2024
88aed70
Update code/Test_definitions/Geofencing.feature
mdomale Aug 28, 2024
65919a0
Update code/Test_definitions/Geofencing.feature
mdomale Aug 28, 2024
7aafd88
Update Geofencing.feature
mdomale Aug 28, 2024
fc4b480
Update Geofencing.feature
mdomale Aug 28, 2024
ba17839
Update code/Test_definitions/Geofencing.feature
mdomale Aug 28, 2024
b9fd8c9
Update code/Test_definitions/Geofencing.feature
mdomale Aug 28, 2024
a2893a6
Update code/Test_definitions/Geofencing.feature
mdomale Aug 28, 2024
188c49c
Update code/Test_definitions/Geofencing.feature
mdomale Aug 28, 2024
38f1660
Update Geofencing.feature
mdomale Aug 28, 2024
9fcd8f1
Update Geofencing.feature
mdomale Aug 28, 2024
7d91a4a
Update Geofencing.feature
mdomale Aug 28, 2024
f26f845
Update Geofencing.feature
mdomale Aug 29, 2024
888f6ba
Update code/Test_definitions/Geofencing.feature
mdomale Aug 29, 2024
05186ee
Update code/Test_definitions/Geofencing.feature
mdomale Aug 29, 2024
91eb45e
Update code/Test_definitions/Geofencing.feature
mdomale Aug 29, 2024
cde7ad6
Update code/Test_definitions/Geofencing.feature
mdomale Aug 29, 2024
c449069
Update code/Test_definitions/Geofencing.feature
mdomale Aug 29, 2024
2e1fbae
Update code/Test_definitions/Geofencing.feature
mdomale Aug 29, 2024
2b337f7
Update code/Test_definitions/Geofencing.feature
mdomale Aug 29, 2024
7056453
Update code/Test_definitions/Geofencing.feature
mdomale Aug 29, 2024
bfe30d1
Update Geofencing.feature
mdomale Aug 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
261 changes: 261 additions & 0 deletions code/Test_definitions/Geofencing.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,261 @@


@Geofencing
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.3.0

Background: Common Geofencing Subscriptions setup
Given the resource "/geofencing-subscriptions/v0.3/subscriptions" as geofencing Url |
mdomale marked this conversation as resolved.
Show resolved Hide resolved
And the header "Content-Type" is set to "application/json"
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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
mdomale marked this conversation as resolved.
Show resolved Hide resolved

@geofencing_subscriptions_01_Create_geofencing_subscription_for_a_device
mdomale marked this conversation as resolved.
Show resolved Hide resolved
Scenario: Create geofencing subscription
mdomale marked this conversation as resolved.
Show resolved Hide resolved
mdomale marked this conversation as resolved.
Show resolved Hide resolved
Given the appropriate values are used for geofencing
mdomale marked this conversation as resolved.
Show resolved Hide resolved
When the creation of subscription method is triggered is performed
mdomale marked this conversation as resolved.
Show resolved Hide resolved
Then the response code is 201
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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"

mdomale marked this conversation as resolved.
Show resolved Hide resolved

@geofencing_subscriptions_02_Operation_to_retrieve_list_of_subscriptions
Scenario: Get a list of subscriptions.
Given the appropriate values are used for geofencing
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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
And the response body complies with the OAS schema at "/components/schemas/Subscription"
mdomale marked this conversation as resolved.
Show resolved Hide resolved


@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
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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
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
mdomale marked this conversation as resolved.
Show resolved Hide resolved
When the delete subscription method is triggered for subscription-id
Then the response code is 204
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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 the appropriate values are used for geofencing
When the create subscription method is triggered with invalid parameter
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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 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
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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
mdomale marked this conversation as resolved.
Show resolved Hide resolved
Given the appropriate values are used for geofencing
When the delete subscription method is triggered with invalid subscription-id
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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
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
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
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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
Scenario: Subscription creation when service have area-entered event
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we wanted to test that event is received when the device enters in some area I would write it as:

Scenario: Events are received for a created subscription for area-entered event
Given an existing subscription to area-entered for a device and an area
When the device enters the area
Then an event is received in the subscription callback url
And the event request body complies with the schema at "/components/schemas/EventAreaEntered"

More scenarios could be added to test the other type of events

That's a minimum. An enhanced scenario should validate that properties make sense, authorization is according to the subscription sink credentials, etc

Given the appropriate values are used for geofencing
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
Scenario: Subscription creation when service have area-left event
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments as above

Given the appropriate values are used for geofencing
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"
mdomale marked this conversation as resolved.
Show resolved Hide resolved
Then they get event details from notifications-url
Then the response code is 200
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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 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
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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
Scenario: Get geofencing subscription with invalid subscription-id format
mdomale marked this conversation as resolved.
Show resolved Hide resolved
Given the appropriate values are used for geofencing
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

@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

@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.
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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"
mdomale marked this conversation as resolved.
Show resolved Hide resolved



@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
mdomale marked this conversation as resolved.
Show resolved Hide resolved
Then the response code is 404
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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_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
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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.
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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
mdomale marked this conversation as resolved.
Show resolved Hide resolved
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