From 07ffed993159a1b909d897b892a927dfce5c766d Mon Sep 17 00:00:00 2001 From: Maximilian Laue Date: Thu, 15 May 2025 22:27:06 +0200 Subject: [PATCH 1/9] feat: add gherkin linting --- .gherkin-lintrc | 74 ++++++++++++++++++++++++++++++++ .github/workflows/megalinter.yml | 8 +++- .spectral.yml | 40 ++++++++++------- 3 files changed, 104 insertions(+), 18 deletions(-) create mode 100644 .gherkin-lintrc diff --git a/.gherkin-lintrc b/.gherkin-lintrc new file mode 100644 index 00000000..f22892ae --- /dev/null +++ b/.gherkin-lintrc @@ -0,0 +1,74 @@ +{ + "no-files-without-scenarios" : "on", + "no-unnamed-features": "on", + "no-unnamed-scenarios": "on", + "no-dupe-scenario-names": ["on", "in-feature"], + "no-dupe-feature-names": "on", + "no-partially-commented-tag-lines": "on", + "indentation" : [ + "on", { + "Feature": 0, + "Background": 2, + "Scenario": 2, + "Step": 2, + "Examples": 4, + "example": 6, + "given": 4, + "when": 4, + "then": 4, + "and": 4, + "but": 4, + "feature tag": 2, + "scenario tag": 2 + } + ], + "no-trailing-spaces": "on", + "new-line-at-eof": ["on", "no"], + "no-multiple-empty-lines": "on", + "no-empty-file": "on", + "no-scenario-outlines-without-examples": "on", + "name-length": ["on", {"Feature": 90, "Step": 190, "Scenario": 190}], + "no-restricted-tags": ["on", {"tags": ["@watch", "@wip"]}], + "use-and": "on", + "keywords-in-logical-order": "on", + "no-duplicate-tags": "on", + "no-superfluous-tags": "on", + "no-homogenous-tags": "on", + "one-space-between-tags": "on", + "no-unused-variables": "on", + "no-background-only-scenario": "on", + "no-empty-background": "on", + "scenario-size": ["on", { "steps-length": {"Background": 15, "Scenario": 15}}], + "only-one-when": "off", + "allowed-tags": ["on", { + "patterns": [ + "^@watch$", + "^@wip$", + "^@.*$" + ] + }], + "file-name": ["off", {"style": "kebab-case"}], + "max-scenarios-per-file": ["on", {"maxScenarios": 50, "countOutlineExamples": true}], + "no-restricted-patterns": ["on", { + "Global": [ + "^globally restricted pattern" + ], + "Feature": [ + "poor description", + "validate", + "verify" + ], + "Background": [ + "show last response", + "a debugging step" + ], + "Scenario": [ + "show last response", + "a debugging step" + ] + }], + "required-tags": ["on", { + "tags": ["^@.*$"], // Allow any tag starting with '@' + "ignoreUntagged": false // Enforce tagging +}] +} diff --git a/.github/workflows/megalinter.yml b/.github/workflows/megalinter.yml index 6bda7009..acc4f5bd 100644 --- a/.github/workflows/megalinter.yml +++ b/.github/workflows/megalinter.yml @@ -42,8 +42,12 @@ jobs: run: npm install -g @stoplight/spectral - name: Install Spectral functions run: npm install -g @stoplight/spectral-functions - # - name: Run spectral:oas Spectral Linting - # run: spectral lint code/API_definitions/*.yaml --verbose --ruleset .spectral.yml + - name: Install Gherkin Linter + run: npm install -g gherkin-lint + - name: Run Gherkin Linting + run: gherkin-lint code/Test_definitions/*.feature + # - name: Run spectral:oas Spectral Linting + # run: spectral lint code/API_definitions/*.yaml --verbose --ruleset .spectral.yml # Replace openapi.yaml file with your API specification file # MegaLinter diff --git a/.spectral.yml b/.spectral.yml index 0042b3c4..4fcad638 100644 --- a/.spectral.yml +++ b/.spectral.yml @@ -3,6 +3,8 @@ # Changelog: # - 31.01.2024: Initial version # - 19.03.2024: Corrected camara-http-methods rule +# - 03.12.2024: Corrected camara-path-param-id and camara-discriminator-use to handle null values error in example fields +# - 09.01.2025: Updated info-contact rule extends: "spectral:oas" @@ -16,7 +18,7 @@ rules: # The severity keyword is optional in rule definition and can be error, warn, info, hint, or off. The default value is warn. contact-properties: false duplicated-entry-in-enum: true - info-contact: true + info-contact: false info-description: true info-license: true license-url: true @@ -84,16 +86,16 @@ rules: description: | This rule ensures consistent and descriptive naming for path parameters in your OpenAPI specification. Please use 'resource_id' instead of just 'id' for your path parameters. - given: "$..parameters[?(@.in == 'path')]" + given: "$.paths[*][*].parameters[?(@.in == 'path')].name" then: field: name function: pattern functionOptions: - notMatch: \b(id|Id|ID|iD)\b + match: "^(?!.*\\b(id|Id|ID|iD)\\b).*$" recommended: true # Set to true/false to enable/disable this rule camara-security-no-secrets-in-path-or-query-parameters: - message: "Sensitive data found in path: {{error}} Consider avoiding the use of Sesentive data " + message: "Sensitive data found in path: {{error}} Consider avoiding the use of sensitive data " severity: warn description: | This rule checks for sensitive data ('MSISDN' and 'IMSI') in API paths and suggests avoiding their use. @@ -146,8 +148,8 @@ rules: message: "Functionality method description Warning: Each method should have description." severity: warn description: | - This rule checks if each operation (POST, GET, DELETE, PUT, PATCH, OPTIONS) in your API specification has a description. - Ensure that you have added a 'summary' field for each operation in your OpenAPI specification. + This rule checks if each operation (POST, GET, DELETE, PUT, PATCH, OPTIONS) in your API specification has a description. + Ensure that you have added a 'summary' field for each operation in your OpenAPI specification. given: - "$.paths.*.post" - "$.paths.*.get" @@ -159,7 +161,7 @@ rules: field: description function: truthy recommended: true # Set to true/false to enable/disable this rule - + camara-parameters-descriptions: message: "Parameter description is missing or empty: {{error}}" severity: warn @@ -171,7 +173,7 @@ rules: field: description function: truthy recommended: true # Set to true/false to enable/disable this rule - + camara-response-descriptions: message: "Parameter description is missing or empty: {{error}}" severity: warn @@ -196,13 +198,13 @@ rules: field: description function: truthy recommended: true # Set to true/false to enable/disable this rule - + camara-operation-summary: message: "Operation Summary Warning: Each operation should include a short summary for better understanding." severity: warn description: | - This rule checks if each operation (POST, GET, DELETE, PUT, PATCH, OPTIONS) in your API specification has a meaningful summary. - Ensure that you have added a 'summary' field for each operation in your OpenAPI specification. + This rule checks if each operation (POST, GET, DELETE, PUT, PATCH, OPTIONS) in your API specification has a meaningful summary. + Ensure that you have added a 'summary' field for each operation in your OpenAPI specification. given: - "$.paths.*.post" - "$.paths.*.get" @@ -219,18 +221,24 @@ rules: description: | Ensure that API definition YAML files with oneOf or anyOf sections include a discriminator object for serialization, deserialization, and validation. severity: hint - given: "$..[?(@.oneOf || @.anyOf)]" + given: "$.components.schemas[*]" then: - field: discriminator - function: truthy - description: "Discriminator object is required when using oneOf or anyOf." + - field: oneOf + function: truthy + message: "Schemas with 'oneOf' should include a 'discriminator' for type identification." + - field: anyOf + function: truthy + message: "Schemas with 'anyOf' should include a 'discriminator' for type identification." + - field: discriminator + function: truthy + message: "A 'discriminator' object is required when using 'oneOf' or 'anyOf'." recommended: true # Set to true/false to enable/disable this rule camara-operationid-casing-convention: message: Operation Id must be in Camel case "{{error}}" severity: hint description: | - This rule checks Operation ids should follow a specific case convention: camel case. + This rule checks Operation ids should follow a specific case convention: camel case. given: "$.paths.*.*.operationId" then: function: casing From fdbb46ce32d31e0ef76ccc18d2db16dedefdcf08 Mon Sep 17 00:00:00 2001 From: Maximilian Laue Date: Tue, 20 May 2025 09:25:26 +0200 Subject: [PATCH 2/9] fix: remove "verify" in .gherkin-lintrc --- .gherkin-lintrc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.gherkin-lintrc b/.gherkin-lintrc index f22892ae..f0319799 100644 --- a/.gherkin-lintrc +++ b/.gherkin-lintrc @@ -55,8 +55,7 @@ ], "Feature": [ "poor description", - "validate", - "verify" + "validate" ], "Background": [ "show last response", @@ -68,7 +67,7 @@ ] }], "required-tags": ["on", { - "tags": ["^@.*$"], // Allow any tag starting with '@' - "ignoreUntagged": false // Enforce tagging + "tags": ["^@.*$"], + "ignoreUntagged": false }] } From 366efe7e8bd3460a223e817d30d6978cddf51fb2 Mon Sep 17 00:00:00 2001 From: Maximilian Laue Date: Tue, 17 Jun 2025 10:20:07 +0200 Subject: [PATCH 3/9] test: add "verify" again --- .gherkin-lintrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gherkin-lintrc b/.gherkin-lintrc index f0319799..1fa9eb03 100644 --- a/.gherkin-lintrc +++ b/.gherkin-lintrc @@ -55,7 +55,8 @@ ], "Feature": [ "poor description", - "validate" + "validate", + "verify" ], "Background": [ "show last response", From e606520032d0b899f9eaec185ad791cf26f6e9c5 Mon Sep 17 00:00:00 2001 From: Maximilian Laue Date: Tue, 17 Jun 2025 10:39:16 +0200 Subject: [PATCH 4/9] fix: remvoe "verify" again --- .gherkin-lintrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.gherkin-lintrc b/.gherkin-lintrc index 1fa9eb03..a798b119 100644 --- a/.gherkin-lintrc +++ b/.gherkin-lintrc @@ -56,7 +56,6 @@ "Feature": [ "poor description", "validate", - "verify" ], "Background": [ "show last response", From 64f381fcd684b4b087c6d9e969d7410900fc6b9b Mon Sep 17 00:00:00 2001 From: Maximilian Laue Date: Wed, 18 Jun 2025 22:06:48 +0200 Subject: [PATCH 5/9] fix: remvoe comma --- .gherkin-lintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gherkin-lintrc b/.gherkin-lintrc index a798b119..f0319799 100644 --- a/.gherkin-lintrc +++ b/.gherkin-lintrc @@ -55,7 +55,7 @@ ], "Feature": [ "poor description", - "validate", + "validate" ], "Background": [ "show last response", From 0287c1e0d36166dd7bfaf5e5131af67efe3c5302 Mon Sep 17 00:00:00 2001 From: Maximilian Laue Date: Fri, 1 Aug 2025 14:07:03 +0200 Subject: [PATCH 6/9] fix: gherkin for geofencing-subscriptions.feature --- .../geofencing-subscriptions.feature | 99 +++++++++---------- 1 file changed, 49 insertions(+), 50 deletions(-) diff --git a/code/Test_definitions/geofencing-subscriptions.feature b/code/Test_definitions/geofencing-subscriptions.feature index 3124e829..b03761d8 100644 --- a/code/Test_definitions/geofencing-subscriptions.feature +++ b/code/Test_definitions/geofencing-subscriptions.feature @@ -1,4 +1,3 @@ -@Geofencing Feature: Camara Geofencing Subscriptions API, vwip - Operations on subscriptions # Input to be provided by the implementation to the tester @@ -21,7 +20,7 @@ Feature: Camara Geofencing Subscriptions API, vwip - Operations on subscriptions @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 + And a valid subscription request body When the request "createGeofencingSubscription" is sent Then the response code is 201 And the response header "Content-Type" is "application/json" @@ -41,7 +40,7 @@ Feature: Camara Geofencing Subscriptions API, vwip - Operations on subscriptions @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 + 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" @@ -50,7 +49,7 @@ Feature: Camara Geofencing Subscriptions API, vwip - Operations on subscriptions @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 + 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" @@ -72,48 +71,48 @@ Feature: Camara Geofencing Subscriptions API, vwip - Operations on subscriptions Then the response code is 202 or 204 And the response header "x-correlator" has same value as the request header "x-correlator" And if the response property $.status is 204 then response body is not available - And if the response property $.status is 202 then response body complies with the OAS schema at "/components/schemas/SubscriptionAsync" + And if the response property $.status is 202 then response body complies with the OAS schema at "/components/schemas/SubscriptionAsync" @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" - And the request body property "$.type" is "area-entered" + 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 "createGeofencingSubscription" 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 the device entered location "Place1" + And 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_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" - And the request body property "$.type" is "area-left" + 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 "createGeofencingSubscription" 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 the device left from location "Place1" + And 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_09_subscription_ends_on_expiry Scenario: Receive notification for subscription-ended event on expiry - Given a valid subscription request body - And the request body property "$.area" is set to circle which covers location "Place1" + 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" is set to a value in the near future When the request "createGeofencingSubscription" is sent - Then the response code is 201 - Then the subscription is expired - Then event notification "subscription-ended" is received on callback-url + Then the response code is 201 + And the subscription is expired + And event notification "subscription-ended" is received on callback-url And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnded" And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ended" And the response property "$.terminationReason" is "SUBSCRIPTION_EXPIRED" - + @geofencing_subscriptions_10_subscription_ends_on_max_events Scenario: Receive notification for subscription-ended event on max events reached Given a valid subscription request body @@ -122,21 +121,21 @@ Feature: Camara Geofencing Subscriptions API, vwip - Operations on subscriptions And the request body property "$.subscriptionMaxEvents" is set to 1 When the request "createGeofencingSubscription" 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-ended" is received on callback-url + And the device left from location "Place1" + And event notification "area-left" is received on callback-url + And event notification "subscription-ended" is received on callback-url And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnded" And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ended"And the response property "$.terminationReason" is "MAX_EVENTS_REACHED" - + @geofencing_subscriptions_11_subscription_delete_event_validation Scenario: Receive notification for subscription-ended event on deletion - Given a valid subscription request body + Given a valid subscription request body When the request "createGeofencingSubscription" is sent - Then the response code is 201 - And path parameter "subscriptionId" is set to the identifier of an existing subscription created + Then the response code is 201 + 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-ended" is received on callback-url + Then the response code is 202 or 204 + And event notification "subscription-ended" is received on callback-url And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnded" And type="org.camaraproject.geofencing-subscriptions.v0.subscription-ended" And the response property "$.terminationReason" is "SUBSCRIPTION_DELETED" @@ -164,26 +163,26 @@ Feature: Camara Geofencing Subscriptions API, vwip - Operations on subscriptions @geofencing_subscriptions_13_creation_of_subscription_with_expiry_time_in_past Scenario: Expiry time in past - Given a valid subscription request body + Given a valid subscription request body And request body property "$.subscriptionexpiretime" in past When the request "createGeofencingSubscription" 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_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 + Given a valid subscription request body + And the request body property "$.types" is set to invalid value When the request "createGeofencingSubscription" is sent 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_15_invalid_protocol Scenario: Subscription creation with invalid protocol - Given a valid subscription request body + Given a valid subscription request body When the request "createGeofencingSubscription" is sent 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" @@ -195,7 +194,7 @@ Feature: Camara Geofencing Subscriptions API, vwip - Operations on subscriptions @geofencing_subscription_16_invalid_credential Scenario: Subscription creation with invalid credential - Given a valid subscription request body + Given a valid subscription request body When the request "createGeofencingSubscription" is sent And the request property "$.types" is set to "org.camaraproject.geofencing-subscriptions.v0.area-entered" And the request property "$.protocol" is set to "HTTP" @@ -235,7 +234,7 @@ Feature: Camara Geofencing Subscriptions API, vwip - Operations on subscriptions @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 set to + Given a valid subscription request body and header "Authorization" is not set to When the request "createGeofencingSubscription" is sent Then the response status code is 401 And the response property "$.status" is 401 @@ -253,7 +252,7 @@ Feature: Camara Geofencing Subscriptions API, vwip - Operations on subscriptions @geofencing_subscriptions_20_invalid_access_token_for_create_subscription Scenario: Invalid access token for create subscription - Given a valid subscription request body + Given a valid subscription request body And header "Authorization" set to an invalid access token When the request "createGeofencingSubscription" is sent Then the response status code is 401 @@ -261,12 +260,12 @@ Feature: Camara Geofencing Subscriptions API, vwip - Operations on subscriptions 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_for_get_subscription Scenario: No Authorization header for get subscription 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 + 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" @@ -280,7 +279,7 @@ Feature: Camara Geofencing Subscriptions API, vwip - Operations on subscriptions 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_for_get_subscription Scenario: Invalid access token for get subscription Given the header "Authorization" set to an invalid access token @@ -290,11 +289,11 @@ Feature: Camara Geofencing Subscriptions API, vwip - Operations on subscriptions 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_no_authorization_header_for_delete_subscription Scenario: No Authorization header for delete subscription Given header "Authorization" is set without a token - When the request "deleteGeofencingSubscription" is sent + 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" @@ -320,7 +319,7 @@ Feature: Camara Geofencing Subscriptions API, vwip - Operations on subscriptions And the response property "$.message" contains a user friendly text @geofencing_subscriptions_26_get_unknown_geofencing_subscription_for_a_device - Scenario: Get method for geofencing subscription with subscription-id unknown to the system + Scenario: Get method for geofencing subscription with subscription-id unknown to the 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 @@ -338,8 +337,8 @@ Feature: Camara Geofencing Subscriptions API, vwip - Operations on subscriptions And the response property "$.message" contains a user friendly text @geofencing_subscriptions_28_create_with_an_unsupported_area - Scenario: Create subscription with an invalid area - Given the request body property "$.area" is set to an unsupported or invalid area + Scenario: Create subscription with an unsupported area + Given the request body property "$.area" is set to an unsupported When the HTTP "POST" request is sent Then the response status code is 422 And the response property "$.status" is 422 @@ -392,4 +391,4 @@ Feature: Camara Geofencing Subscriptions API, vwip - Operations on subscriptions Then the response status code is 422 And the response property "$.status" is 422 And the response property "$.code" is "MISSING_IDENTIFIER" - And the response property "$.message" contains a user-friendly text + And the response property "$.message" contains a user-friendly text \ No newline at end of file From 03df5a39b2bf86b00f9635b07399cb6dde6d8ce2 Mon Sep 17 00:00:00 2001 From: Maximilian Laue Date: Fri, 1 Aug 2025 14:07:50 +0200 Subject: [PATCH 7/9] fix: gherkin for location-retrieval.feature --- code/Test_definitions/location-retrieval.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/Test_definitions/location-retrieval.feature b/code/Test_definitions/location-retrieval.feature index 096b8933..51d21875 100644 --- a/code/Test_definitions/location-retrieval.feature +++ b/code/Test_definitions/location-retrieval.feature @@ -201,7 +201,7 @@ Feature: CAMARA Device location retrieval API, vwip - Operation retrieveLocation And the response property "$.status" is 422 And the response property "$.code" is "LOCATION_RETRIEVAL.UNABLE_TO_FULFILL_MAX_SURFACE" And the response property "$.message" contains a user friendly text - + # Generic 400 errors @location_retrieval_400.1_no_request_body @@ -266,4 +266,4 @@ Feature: CAMARA Device location retrieval API, vwip - Operation retrieveLocation Then the response status code is 403 And the response property "$.status" is 403 And the response property "$.code" is "PERMISSION_DENIED" - And the response property "$.message" contains a user friendly text + And the response property "$.message" contains a user friendly text \ No newline at end of file From 3758c9f0a15d443c221318cd5f041b0aa2469e10 Mon Sep 17 00:00:00 2001 From: Maximilian Laue Date: Fri, 1 Aug 2025 14:08:57 +0200 Subject: [PATCH 8/9] fix: gherkin for location-verification.feature --- .../location-verification.feature | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/code/Test_definitions/location-verification.feature b/code/Test_definitions/location-verification.feature index afb38a12..72e98e0c 100644 --- a/code/Test_definitions/location-verification.feature +++ b/code/Test_definitions/location-verification.feature @@ -88,7 +88,6 @@ Feature: CAMARA Device location verification API, vwip - Operation verifyLocatio And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text - @location_verification_C01.02_device_identifiers_not_schema_compliant Scenario Outline: Some device identifier value does not comply with the schema Given the header "Authorization" is set to a valid access token which does not identify a single device @@ -106,7 +105,6 @@ Feature: CAMARA Device location verification API, vwip - Operation verifyLocatio | $.device.ipv6Address | /components/schemas/DeviceIpv6Address | | $.device.networkIdentifier | /components/schemas/NetworkAccessIdentifier | - # This scenario may happen e.g. with 2-legged access tokens, which do not identify a single device. @location_verification_C01.03_device_not_found Scenario: Some identifier cannot be matched to a device @@ -118,7 +116,6 @@ Feature: CAMARA Device location verification API, vwip - Operation verifyLocatio And the response property "$.code" is "IDENTIFIER_NOT_FOUND" And the response property "$.message" contains a user friendly text - @location_verification_C02.04_unnecessary_device Scenario: Device not to be included when it can be deduced from the access token Given the header "Authorization" is set to a valid access token identifying a device @@ -129,7 +126,6 @@ Feature: CAMARA Device location verification API, vwip - Operation verifyLocatio And the response property "$.code" is "UNNECESSARY_IDENTIFIER" And the response property "$.message" contains a user-friendly text - @location_verification_C01.05_missing_device Scenario: Device not included and cannot be deduced from the access token Given the header "Authorization" is set to a valid access token which does not identify a single device @@ -140,7 +136,6 @@ Feature: CAMARA Device location verification API, vwip - Operation verifyLocatio And the response property "$.code" is "MISSING_IDENTIFIER" And the response property "$.message" contains a user-friendly text - @location_verification_C01.06_unsupported_device Scenario: None of the provided device identifiers is supported by the implementation Given that some types of device identifiers are not supported by the implementation @@ -152,7 +147,6 @@ Feature: CAMARA Device location verification API, vwip - Operation verifyLocatio And the response property "$.code" is "UNSUPPORTED_IDENTIFIER" And the response property "$.message" contains a user-friendly text - # When the service is only offered to certain types of devices or subscriptions, e.g. IoT, B2C, etc. @location_verification_C01.07_device_not_supported Scenario: Service not available for the device @@ -280,12 +274,11 @@ Feature: CAMARA Device location verification API, vwip - Operation verifyLocatio And the response property "$.code" is "LOCATION_VERIFICATION.AREA_NOT_COVERED" And the response property "$.message" contains a user-friendly text - @location_verification_422.2_area_too_small Scenario: Area too small - Given that there is a minimum radius allowed by the implementation + Given that there is a minimum radius allowed by the implementation And a valid testing device supported by the service identified, by the token or provided in the request body - And the request body property "$.area.areaType" is set to "CIRCLE" + And the request body property "$.area.areaType" is set to "CIRCLE" And the request body property "$.area.center" is set to a location covered by the implementation And the request body property "$.area.radius" is set to a value smaller than the minimum allowed And the request body property "$.maxAge" is not included @@ -295,7 +288,6 @@ Feature: CAMARA Device location verification API, vwip - Operation verifyLocatio And the response property "$.code" is "LOCATION_VERIFICATION.INVALID_AREA" And the response property "$.message" contains a user-friendly text - @location_verification_422.3_unable_to_fulfill_max_age Scenario: Unable to fulfill max age Given a valid testing device supported by the service, identified by the token or provided in the request body, with no historical location information for some time @@ -307,7 +299,6 @@ Feature: CAMARA Device location verification API, vwip - Operation verifyLocatio And the response property "$.code" is "LOCATION_VERIFICATION.UNABLE_TO_FULFILL_MAX_AGE" And the response property "$.message" contains a user-friendly text - @location_verification_422.4_unknown_location_for_device Scenario: Unknown location of a device without specifying maxAge Given a valid testing device supported by the service, identified by the token or provided in the request body, for which there is no historical location information @@ -317,4 +308,4 @@ Feature: CAMARA Device location verification API, vwip - Operation verifyLocatio Then the response status code is 422 And the response property "$.status" is 422 And the response property "$.code" is "LOCATION_VERIFICATION.UNABLE_TO_LOCATE" - And the response property "$.message" contains a user-friendly text + And the response property "$.message" contains a user-friendly text \ No newline at end of file From 9073e0e4bdd51d6257b5d8456bf084af014c1ccf Mon Sep 17 00:00:00 2001 From: Maximilian Laue Date: Thu, 7 Aug 2025 09:13:51 +0200 Subject: [PATCH 9/9] fix: gherkin issue in geofencing-subscriptions.feature --- code/Test_definitions/geofencing-subscriptions.feature | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/code/Test_definitions/geofencing-subscriptions.feature b/code/Test_definitions/geofencing-subscriptions.feature index b03761d8..e929ca7e 100644 --- a/code/Test_definitions/geofencing-subscriptions.feature +++ b/code/Test_definitions/geofencing-subscriptions.feature @@ -129,11 +129,10 @@ Feature: Camara Geofencing Subscriptions API, vwip - Operations on subscriptions @geofencing_subscriptions_11_subscription_delete_event_validation Scenario: Receive notification for subscription-ended event on deletion - Given a valid subscription request body - When the request "createGeofencingSubscription" is sent - Then the response code is 201 - And path parameter "subscriptionId" is set to the identifier of an existing subscription created + Given a valid subscription is existing When the request "deleteGeofencingSubscription" is sent + And path parameter "subscriptionId" is set to the identifier of an existing subscription created + And the request "deleteGeofencingSubscription" is sent Then the response code is 202 or 204 And event notification "subscription-ended" is received on callback-url And notification body complies with the OAS schema at "##/components/schemas/EventSubscriptionEnded"