From ad03bb767d0eab1dab2f895ff3e7778c5e6b63a0 Mon Sep 17 00:00:00 2001 From: hdamker-bot Date: Wed, 20 Aug 2025 13:12:38 +0000 Subject: [PATCH 1/7] admin: migrate to centralized linting workflows Applied via project-admin workflow Repository: PredictiveConnectivityData Operation: centralize-linting-workflows --- .gherkin-lintrc | 73 ----- .github/workflows/megalinter.yml | 78 ------ .github/workflows/pr_validation_caller.yml | 49 ++++ .github/workflows/spectral-oas-caller.yml | 42 +++ .github/workflows/spectral_oas_lint.yml | 36 --- .spectral.yml | 261 ------------------ .yamllint.yaml | 35 --- lint_function/camara-language-avoid-telco.js | 40 --- lint_function/camara-reserved-words.js | 99 ------- ...-no-secrets-in-path-or-query-parameters.js | 26 -- 10 files changed, 91 insertions(+), 648 deletions(-) delete mode 100644 .gherkin-lintrc delete mode 100644 .github/workflows/megalinter.yml create mode 100644 .github/workflows/pr_validation_caller.yml create mode 100644 .github/workflows/spectral-oas-caller.yml delete mode 100644 .github/workflows/spectral_oas_lint.yml delete mode 100644 .spectral.yml delete mode 100644 .yamllint.yaml delete mode 100644 lint_function/camara-language-avoid-telco.js delete mode 100644 lint_function/camara-reserved-words.js delete mode 100644 lint_function/camara-security-no-secrets-in-path-or-query-parameters.js diff --git a/.gherkin-lintrc b/.gherkin-lintrc deleted file mode 100644 index 3b9de78..0000000 --- a/.gherkin-lintrc +++ /dev/null @@ -1,73 +0,0 @@ - -{ - "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", - "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" - ], - "Background": [ - "show last response", - "a debugging step" - ], - "Scenario": [ - "show last response", - "a debugging step" - ] - }], - "required-tags": ["on", { - "tags": ["^@.*$"], - "ignoreUntagged": false -}] -} diff --git a/.github/workflows/megalinter.yml b/.github/workflows/megalinter.yml deleted file mode 100644 index 4d075b2..0000000 --- a/.github/workflows/megalinter.yml +++ /dev/null @@ -1,78 +0,0 @@ ---- -# MegaLinter GitHub Action configuration file -# More info at https://megalinter.io -# CAMARA Project - Github Action for Pull Reqests -# 31.01.2024 - initial version - -name: MegaLinter - -on: # yamllint disable-line rule:truthy - # Pull Requests to main - pull_request: - branches: [master, main] - -env: # Comment env block if you do not want to apply fixes - # Apply linter fixes configuration - APPLY_FIXES: all # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool) - APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all) - APPLY_FIXES_MODE: commit # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request) - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }} - cancel-in-progress: true - -jobs: - build: - name: MegaLinter - runs-on: ubuntu-latest - permissions: - # Give the default GITHUB_TOKEN write permission to commit and push, comment issues & post new PR - # Remove the ones you do not need - contents: write - issues: write - pull-requests: write - steps: - # Git Checkout - - name: Checkout Code - uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - fetch-depth: 0 # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to improve performances - - name: Install Spectral - 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 - # Replace openapi.yaml file with your API specification file - - # MegaLinter - - name: MegaLinter - id: ml - # You can override MegaLinter flavor used to have faster performances - # More info at https://megalinter.io/flavors/ - uses: oxsecurity/megalinter/flavors/java@v7.3.0 - env: - # All available variables are described in documentation - # https://megalinter.io/configuration/ - PRINT_ALPACA: false - # VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Validates all source when push on main, else just the git diff with main. Override with true if you always want to lint all sources - VALIDATE_ALL_CODEBASE: true - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY - DISABLE: COPYPASTE,MARKDOWN - DISABLE_LINTERS: SPELL_CSPELL,SPELL_LYCHEE,YAML_PRETTIER,REPOSITORY_GRYPE,REPOSITORY_SEMGREP,REPOSITORY_DEVSKIM,REPOSITORY_KICS,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,REPOSITORY_CHECKOV,REPOSITORY_GITLEAKS,YAML_V8R,JAVA_PMD,JAVA_CHECKSTYLE,OPENAPI_SPECTRAL - YAML_YAMLLINT_CONFIG_FILE: ".yamllint.yaml" - OPENAPI_SPECTRAL_CONFIG_FILE: ".spectral.yml" - YAML_YAMLLINT_FILTER_REGEX_INCLUDE: "(code/)" - OPENAPI_SPECTRAL_FILTER_REGEX_INCLUDE: "(code/)" - - # Upload MegaLinter artifacts - - name: Archive production artifacts - if: ${{ success() }} || ${{ failure() }} - uses: actions/upload-artifact@v4 - with: - name: MegaLinter reports - path: | - megalinter-reports - mega-linter.log \ No newline at end of file diff --git a/.github/workflows/pr_validation_caller.yml b/.github/workflows/pr_validation_caller.yml new file mode 100644 index 0000000..d847f6e --- /dev/null +++ b/.github/workflows/pr_validation_caller.yml @@ -0,0 +1,49 @@ +# ========================================================================================= +# CAMARA Project - Pull Request Validation Workflow Caller +# +# This GitHub Actions workflow is responsible for invoking a reusable PR validation workflow +# from the camaraproject/tooling repository. It is intended to ensure consistent validation +# steps for all PRs targeting the main branch in this repository. +# +# CHANGELOG: +# - 2025-08-01: Initial version for v0 +# +# USAGE: +# - Automatically triggers on pull requests targeting main. +# - Can be triggered manually via workflow_dispatch. +# - Calls by default the reusable workflow at +# camaraproject/tooling/.github/workflows/pr_validation.yml@v0 +# +# DOCUMENTATION: +# see https://github.com/camaraproject/tooling/tree/main/linting/docs +# ========================================================================================= + +name: Caller for PR validation workflow + +on: + # Trigger on pull requests to the main branch only + pull_request: + branches: main + # Enable manual trigger via the GitHub UI + workflow_dispatch: + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + +permissions: + # Grant necessary write permissions for PRs, contents, and issues + pull-requests: write + contents: write + issues: write + statuses: write + +jobs: + pr_validation: + # Invoke the reusable PR validation workflow from "v0" tag of camaraproject/tooling + uses: camaraproject/tooling/.github/workflows/pr_validation.yml@v0 + secrets: inherit +# Tools configuration from the tooling repository subfolder of /linting/config/ indicated by `configurations` variable +# If needed, you can specify a configuration from another subfolder of camaraproject/tooling/linting/config/ (uncomment below) +# with: +# configurations: api-name diff --git a/.github/workflows/spectral-oas-caller.yml b/.github/workflows/spectral-oas-caller.yml new file mode 100644 index 0000000..05cde3f --- /dev/null +++ b/.github/workflows/spectral-oas-caller.yml @@ -0,0 +1,42 @@ +# ========================================================================================= +# CAMARA Project - Linting OpenAPI Specification with CAMARA Ruleset Caller +# +# This GitHub Actions workflow is responsible for invoking a reusable "Spectral linting with +# CAMARA ruleset" workflow from the camaraproject/tooling repository. It is intended to +# provide more detailed output from Spectral tool (warnings, hints) +# +# CHANGELOG: +# - 2025-08-01: Initial version for v0 +# +# USAGE: +# - Can be triggered manually via workflow_dispatch. +# - Calls by default the reusable workflow at +# camaraproject/tooling/.github/workflows/spectral-oas.yml@v0 +# +# DOCUMENTATION: +# see https://github.com/camaraproject/tooling/tree/main/linting/docs +# ========================================================================================= + +name: Caller for Spectral linting with CAMARA ruleset + +on: + workflow_dispatch: + +concurrency: + group: ${{ github.ref }}-${{ github.workflow }} + cancel-in-progress: true + +permissions: + # Grant necessary write permissions for PRs and issues + pull-requests: write + contents: read + issues: write + +jobs: + spectral: + # Invoke the reusable PR validation workflow from the main branch of camaraproject/tooling + uses: camaraproject/tooling/.github/workflows/spectral-oas.yml@v0 +# Spectral configuration from the tooling repository subfolder of /linting/config/ indicated by `configurations` variable +# If needed, you can specify a configuration from another subfolder of camaraproject/tooling/linting/config/ (uncomment below) +# with: +# configurations: api-name diff --git a/.github/workflows/spectral_oas_lint.yml b/.github/workflows/spectral_oas_lint.yml deleted file mode 100644 index 753451c..0000000 --- a/.github/workflows/spectral_oas_lint.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -# CAMARA Project - workflow configuration to manually run CAMARA OAS rules -# see https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow -# 31.01.2024 - initial version - -name: Spectral manual run - -on: workflow_dispatch - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }} - cancel-in-progress: true - -jobs: - build: - name: Spectral linting - runs-on: ubuntu-latest - permissions: - # Give the default GITHUB_TOKEN write permission to commit and push, comment issues & post new PR - # Remove the ones you do not need - contents: write - issues: write - pull-requests: write - steps: - # Git Checkout - - name: Checkout Code - uses: actions/checkout@v4 - with: - token: ${{ secrets.GITHUB_TOKEN }} - fetch-depth: 0 # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to improve performances - - name: Install Spectral - run: npm install -g @stoplight/spectral - - name: Install Spectral functions - run: npm install -g @stoplight/spectral-functions - - name: Run Spectral linting - run: spectral lint code/API_definitions/*.yaml --verbose --ruleset .spectral.yml \ No newline at end of file diff --git a/.spectral.yml b/.spectral.yml deleted file mode 100644 index 8ab2c27..0000000 --- a/.spectral.yml +++ /dev/null @@ -1,261 +0,0 @@ -# CAMARA Project - linting ruleset - documentation avaialable here: -# https://github.com/camaraproject/Commonalities/blob/main/documentation/Linting-rules.md -# Changelog: -# - 31.01.2024: Initial version -# - 19.03.2024: Corrected camara-http-methods rule - - -extends: "spectral:oas" -functions: - - camara-reserved-words - - camara-language-avoid-telco - - camara-security-no-secrets-in-path-or-query-parameters -functionsDir: "./lint_function" -rules: - # Built-in OpenAPI Specification ruleset. Each rule then can be enabled individually. - # 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-description: true - info-license: true - license-url: true - no-$ref-siblings: error - no-eval-in-markdown: true - no-script-tags-in-markdown: true - openapi-tags: false - openapi-tags-alphabetical: false - openapi-tags-uniqueness: error - operation-description: true - operation-operationId: true - operation-operationId-unique: error - operation-operationId-valid-in-url: true - operation-parameters: true - operation-singular-tag: true - operation-success-response: true - operation-tags: true - operation-tag-defined: true - path-declarations-must-exist: true - path-keys-no-trailing-slash: true - path-not-include-query: true - path-params: error - tag-description: false - typed-enum: true - oas3-api-servers: true - oas3-examples-value-or-externalValue: true - oas3-operation-security-defined: false - oas3-parameter-description: false - oas3-schema: true - oas3-server-not-example.com: false - oas3-server-trailing-slash: true - oas3-unused-component: true - oas3-valid-media-example: true - oas3-valid-schema-example: true - # oas3-server-variables: true - - # Custom Rules Utilizing Spectral's Built-in Functions and JavaScript Implementations - - camara-language-avoid-telco: - message: "{{error}}" - severity: hint - description: | - This rule checks for telco-specific terminology in your API definitions and suggests more inclusive terms. - given: "$..*.*" - then: - function: camara-language-avoid-telco - recommended: false # Set to true/false to enable/disable this rule - - camara-oas-version: - message: "OpenAPI Version Error: The OpenAPI specification must adhere to version 3.0.3." - severity: error - description: | - This rule validates the OpenAPI version in your specification and requires compliance with version 3.0.3. - given: "$" - then: - field: openapi - function: pattern - functionOptions: - match: 3.0.3 - recommended: true # Set to true/false to enable/disable this rule - - camara-path-param-id: - message: "Path Parameter Naming Warning: Use 'resource_id' instead of just 'id' in path parameters." - severity: warn - 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')]" - then: - field: name - function: pattern - functionOptions: - notMatch: \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 " - severity: warn - description: | - This rule checks for sensitive data ('MSISDN' and 'IMSI') in API paths and suggests avoiding their use. - given: - - "$.paths" - then: - function: camara-security-no-secrets-in-path-or-query-parameters - recommended: true # Set to true/false to enable/disable this rule - - camara-http-methods: - description: "Ensure that all path URLs have valid HTTP methods (GET, PUT, POST, DELETE, PATCH, OPTIONS)." - message: "Invalid HTTP method for '{{path}}'. Must be one of get, put, post, delete, patch, options." - severity: error - given: $.paths[*][*]~ - then: - function: pattern - functionOptions: - match: "^(get|put|post|delete|patch|options|parameters)$" - recommended: true # Set to true/false to enable/disable this rule - - camara-get-no-request-body: - message: There must be no request body for Get and DELETE - severity: error - given: - - "$.paths.*.get" - - "$.paths.*.delete" - then: - field: requestBody - function: falsy - recommended: true # Set to true/false to enable/disable this rule - - camara-reserved-words: - message: "Reserved words found {{error}} Consider avoiding the use of reserved word " - severity: warn - description: | - This rule checks Reserved words must not be used in the following parts of an API specification [Paths, Request Body properties, Component, Operation Id, Security Schema] - given: - - "$.paths" # Paths - - "$..parameters[*]" # Path or Query Parameter Names: - - "$..components.schemas.*.properties.*" # Request and Response body parameter - - "$.paths.*." # Path and Operation Names: - - "$.components.securitySchemes" # Security Schemes: - - "$.components.*.*" # Component Names: - - "$.paths.*.*.operationId" # OperationIds: - then: - function: camara-reserved-words - recommended: true # Set to true/false to enable/disable this rule - - camara-routes-description: - 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. - given: - - "$.paths.*.post" - - "$.paths.*.get" - - "$.paths.*.delete" - - "$.paths.*.put" - - "$.paths.*.patch" - - "$.paths.*.options" - then: - 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 - description: | - This Spectral rule ensures that each path parameter in the API specification has a descriptive and meaningful description. - given: - - "$.paths..parameters.*" - then: - 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 - description: | - This Spectral rule ensures that each responese object in the API specification has a descriptive and meaningful description. - given: - - "$.paths..responses.*" - then: - field: description - function: truthy - recommended: true # Set to true/false to enable/disable this rule - - camara-properties-descriptions: - message: "Property description is missing or empty: {{error}}" - severity: warn - description: | - This Spectral rule ensures that each propoerty within objects in the API specification has a descriptive and meaningful description. - given: - - "$.components.*.*" - - "$.components.*.*.properties.*" - then: - 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. - given: - - "$.paths.*.post" - - "$.paths.*.get" - - "$.paths.*.delete" - - "$.paths.*.put" - - "$.paths.*.patch" - - "$.paths.*.options" - then: - field: summary - function: truthy - recommended: true # Set to true/false to enable/disable this rule - - camara-discriminator-use: - 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)]" - then: - field: discriminator - function: truthy - description: "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. - given: "$.paths.*.*.operationId" - then: - function: casing - functionOptions: - type: camel - recommended: true # Set to true/false to enable/disable this rule - - camara-schema-casing-convention: - description: This rule checks schema should follow a specific case convention pascal case. - message: "{{property}} should be pascal case (UppperCamelCase)" - severity: warn - given: $.components.schemas[*]~ - then: - function: casing - functionOptions: - type: pascal - recommended: true # Set to true/false to enable/disable this rule - - camara-parameter-casing-convention: - description: Paths should be kebab-case. - severity: error - message: "{{property}} is not kebab-case: {{error}}" - given: $.paths[*]~ - then: - function: pattern - functionOptions: - match: "^\/([a-z0-9]+(-[a-z0-9]+)*)?(\/[a-z0-9]+(-[a-z0-9]+)*|\/{.+})*$" # doesn't allow /asasd{asdas}sadas pattern or not closed braces - recommended: true # Set to true/false to enable/disable this rule \ No newline at end of file diff --git a/.yamllint.yaml b/.yamllint.yaml deleted file mode 100644 index 281dbda..0000000 --- a/.yamllint.yaml +++ /dev/null @@ -1,35 +0,0 @@ ---- -# CAMARA Project - YAML linting configuration for yamllint https://yamllint.readthedocs.io/en/latest/rules.html -# 31.01.2024 - initial version - -yaml-files: - - '*.yaml' - - '*.yml' - - '.yamllint' - -rules: - braces: enable - brackets: enable - colons: enable - commas: enable - comments: - min-spaces-from-content: 1 - level: error - comments-indentation: - level: error - document-end: disable - document-start: disable - empty-lines: enable - empty-values: disable - hyphens: enable - indentation: enable - key-duplicates: enable - key-ordering: disable - line-length: disable - new-line-at-end-of-file: enable - new-lines: disable - octal-values: disable - quoted-strings: disable - trailing-spaces: enable - truthy: - level: error \ No newline at end of file diff --git a/lint_function/camara-language-avoid-telco.js b/lint_function/camara-language-avoid-telco.js deleted file mode 100644 index e9cf205..0000000 --- a/lint_function/camara-language-avoid-telco.js +++ /dev/null @@ -1,40 +0,0 @@ -// CAMARA Project - support function for Spectral linter -// 31.01.2024 - initial version - -const replacements = [ - { original: 'UE', recommended: 'device' }, - { original: 'MSISDN', recommended: 'phone number' }, - { original: 'mobile network', recommended: 'network' } -]; - -export default async function (input) { - const errors = []; - const suggestions = []; - - // Iterate over properties of the input object - for (const path in input) { - const value = input[path]; - - // Check if the value is a string - if (typeof value === 'string') { - for (const replacement of replacements) { - const original = replacement.original; - const recommended = replacement.recommended; - - // Use a regular expression to match 'original' as a standalone word - const regex = new RegExp(`\\b${original}\\b`, 'g'); - - // Check if 'original' exists in the value - if (regex.test(value)) { - errors.push(replacement); - suggestions.push(` Telco-specific terminology found in input: Consider replacing '${original}' with '${recommended}'.`); - } - } - } - } - - // Check if any word from 'replacements' is in the suggestions - if (errors.length > 0) { - console.log(`Hint camara-language-avoid-telco ` + suggestions.join(', ')); - } -}; \ No newline at end of file diff --git a/lint_function/camara-reserved-words.js b/lint_function/camara-reserved-words.js deleted file mode 100644 index c0b98b7..0000000 --- a/lint_function/camara-reserved-words.js +++ /dev/null @@ -1,99 +0,0 @@ - -// CAMARA Project - support function for Spectral linter -// 31.01.2024 - initial version - -const reservedWords = [ - 'abstract', - 'apiclient', - 'apiexception', - 'apiresponse', - 'assert', - 'boolean', - 'break', - 'byte', - 'case', - 'catch', - 'char', - 'class', - 'configuration', - 'const', - 'continue', - 'do', - 'double', - 'else', - 'extends', - 'file', - 'final', - 'finally', - 'float', - 'for', - 'goto', - 'if', - 'implements', - 'import', - 'instanceof', - 'int', - 'interface', - 'list', - 'localdate', - 'localreturntype', - 'localtime', - 'localvaraccept', - 'localvaraccepts', - 'localvarauthnames', - 'localvarcollectionqueryparams', - 'localvarcontenttype', - 'localvarcontenttypes', - 'localvarcookieparams', - 'localvarformparams', - 'localvarheaderparams', - 'localvarpath', - 'localvarpostbody', - 'localvarqueryparams', - 'long', - 'native', - 'new', - 'null', - 'object', - 'offsetdatetime', - 'package', - 'private', - 'protected', - 'public', - 'return', - 'short', - 'static', - 'strictfp', - 'stringutil', - 'super', - 'switch', - 'synchronized', - 'this', - 'throw', - 'throws', - 'transient', - 'try', - 'void', - 'volatile', - 'while' -]; -// Reserved word 'enum' and 'default' are removed from above reserved word array as they are common in openAPI keyword -export default async function lintReservedWords(input) { - // Iterate over properties of the input object - for (const path in input) { - if (typeof path === 'string') { - - for (const word of reservedWords) { - const regex = new RegExp(`\\b${word}\\b`, 'g'); // Use a regular expression to match 'word' as a standalone word - - if (regex.test(path)) { - const warningRuleName = 'camara-reserved-words'; - const description = `Reserved words found in input: Consider avoiding the use of reserved word '${word}'`; - // const location = `${path}`; - - console.log(`warning ${warningRuleName} ${description} ${path}`); - } - } - } - } -} diff --git a/lint_function/camara-security-no-secrets-in-path-or-query-parameters.js b/lint_function/camara-security-no-secrets-in-path-or-query-parameters.js deleted file mode 100644 index 3a3ebd7..0000000 --- a/lint_function/camara-security-no-secrets-in-path-or-query-parameters.js +++ /dev/null @@ -1,26 +0,0 @@ -// CAMARA Project - support function for Spectral linter -// 31.01.2024 - initial version - -const sensitiveData = ['MSISDN','IMSI','phoneNumber']; - -export default async function (input) { - - // Iterate over properties of the input object - for (const path in input) { - - if (typeof path === 'string') { - for (const word of sensitiveData ) { - const regex = new RegExp(`\\b${word}\\b`, 'g'); // Use a regular expression to match 'word' as a standalone word - - if (regex.test(path)) { - - const warningRuleName = 'camara-security-no-secrets-in-path-or-query-parameters'; - const description = `sensitiveData Data found in path: Consider avoiding the use of sensitiveData data '${word}'`; - const location = `paths.${path}`; - console.log(`warning ${warningRuleName} ${description} ${location}`); - - } - } - } - } -} \ No newline at end of file From 3ed8fbb4a197eff131962d482a791c3a105afd9e Mon Sep 17 00:00:00 2001 From: Alberto Ramos Monagas Date: Thu, 21 Aug 2025 09:25:11 +0200 Subject: [PATCH 2/7] @predictive_connectivity_data_403.01_invalid_token_permissions that had the same scenario title as another scenario --- .../predictive-connectivity-data.feature | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/code/Test_definitions/predictive-connectivity-data.feature b/code/Test_definitions/predictive-connectivity-data.feature index 293fb68..f56eb07 100644 --- a/code/Test_definitions/predictive-connectivity-data.feature +++ b/code/Test_definitions/predictive-connectivity-data.feature @@ -1,4 +1,4 @@ -Feature: CAMARA Predictive Connectivity Data API, vwip +Feature: CAMARA Predictive Connectivity Data API, v0.1 # Input to be provided by the implementation to the tester # # Implementation indications: @@ -21,7 +21,7 @@ Feature: CAMARA Predictive Connectivity Data API, vwip Background: Common retrieveConnectivity setup Given an environment at "apiRoot" - And the resource "/predictive-connectivity-data/vwip/retrieve" + And the resource "/predictive-connectivity-data/v0.1/retrieve" 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" complies with the schema at "#/components/schemas/XCorrelator" @@ -99,7 +99,7 @@ Feature: CAMARA Predictive Connectivity Data API, vwip And the response header "x-correlator" has same value as the request header "x-correlator" And the response includes property "$.operationId" And the request with the response body will be received at the address of the request property "$.sink" - And the request will have header "Authorization" set to "Bearer: " + the value of the request property "$.sinkCredential.accessToken" + And the request will have header "Authorization" set to "Bearer " + the value of the request property "$.sinkCredential.accessToken" And the request will have property "$.operationId" equal to response property "$.operationId" And the request body complies with the OAS schema at "/components/schemas/ConnectivityDataAsyncResponse" @@ -122,7 +122,7 @@ Feature: CAMARA Predictive Connectivity Data API, vwip And the response includes property "$.operationId" And there have been some problem processing the request asynchronously And the request with the response body will be received at the address of the request property "$.sink" - And the request will have header "Authorization" set to "Bearer: " + the value of the request property "$.sinkCredential.accessToken" + And the request will have header "Authorization" set to "Bearer " + the value of the request property "$.sinkCredential.accessToken" And the request will have property "$.operationId" equal to response property "$.operationId" And the request body complies with the OAS schema at "/components/schemas/ConnectivityDataAsyncResponse" And the request body will have property "$.status" equal to "OPERATION_NOT_COMPLETED" @@ -169,7 +169,7 @@ Feature: CAMARA Predictive Connectivity Data API, vwip And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities[*]" has only 1 item, corresponding to the layer containing the requested height And the response property "$.requestedHeight" is equal to the request property "$.height" - # If signal strengths is not supported by the implementation this scenario will not apply. Therefore the request body property "$.includeSignalStrength will be ignored and only connectivity quality will be returned. + # If signal strength is not supported by the implementation this scenario will not apply. Therefore the request body property "$.includeSignalStrength" will be ignored and only connectivity quality will be returned. @predictive_connectivity_data_09_include_signal_strength Scenario: Validate success response for a request including signal strength Given the request body property "$.area" is set to a valid testing area within supported regions @@ -373,7 +373,7 @@ Feature: CAMARA Predictive Connectivity Data API, vwip @predictive_connectivity_data_400.15_max_time_period_exceeded Scenario: Error 400 when indicated date-time period is greater than the maximum allowed - Given the request body property "$.startTime" is set to a valid testing future + Given the request body property "$.startTime" is set to a valid testing future date-time And the request body property "$.endTime" is set to a future date-time that exceeds the supported duration from the start time. When the request "retrieveConnectivity" is sent Then the response status code is 400 @@ -431,7 +431,7 @@ Feature: CAMARA Predictive Connectivity Data API, vwip # Error 403 scenarios @predictive_connectivity_data_403.01_invalid_token_permissions - Scenario: Error response for no header "Authorization" + Scenario: Error response for invalid access token permissions # To test this scenario, it will be necessary to obtain a token without the required scope Given the header "Authorization" is set to an access token without the required scope And the request body is set to a valid request body @@ -487,4 +487,4 @@ Feature: CAMARA Predictive Connectivity Data API, vwip Then the response status code is 429 And the response property "$.status" is 429 And the response property "$.code" is "TOO_MANY_REQUESTS" - 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 5f39d5995a42dd9f5ebdc7e617d79caded7455af Mon Sep 17 00:00:00 2001 From: Alberto Ramos Monagas Date: Thu, 21 Aug 2025 13:10:39 +0200 Subject: [PATCH 3/7] Fix ATP validation issues; suggest downgrading name-length and scenario-size to warnings. Updated ErrorInfo property order per CAMARA issue #515. Attached corrected Predictive ATP for public PR update. --- .../predictive-connectivity-data.yaml | 14 +- .../predictive-connectivity-data.feature | 968 +++++++++--------- 2 files changed, 490 insertions(+), 492 deletions(-) diff --git a/code/API_definitions/predictive-connectivity-data.yaml b/code/API_definitions/predictive-connectivity-data.yaml index 67e3113..43c718a 100644 --- a/code/API_definitions/predictive-connectivity-data.yaml +++ b/code/API_definitions/predictive-connectivity-data.yaml @@ -124,13 +124,13 @@ info: license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html - version: wip + version: 0.1.0 x-camara-commonalities: 0.6 externalDocs: description: Product documentation at CAMARA. url: https://github.com/camaraproject/PredictiveConnectivityData servers: - - url: "{apiRoot}/predictive-connectivity-data/vwip" + - url: "{apiRoot}/predictive-connectivity-data/v0.1" variables: apiRoot: default: https://localhost:9091 @@ -726,19 +726,19 @@ components: ErrorInfo: type: object required: - - message - status - code + - message properties: - message: - type: string - description: A human-readable description of what the event represents status: type: integer description: HTTP response status code code: type: string description: A human-readable code to describe the error + message: + type: string + description: A human-readable description of what the event represents responses: RetrieveConnectivityBadRequest400: description: >- @@ -1260,4 +1260,4 @@ components: layerConnectivities: - GC status: SUPPORTED_AREA - requestedHeight: 50 + requestedHeight: 50 \ No newline at end of file diff --git a/code/Test_definitions/predictive-connectivity-data.feature b/code/Test_definitions/predictive-connectivity-data.feature index f56eb07..922bbe9 100644 --- a/code/Test_definitions/predictive-connectivity-data.feature +++ b/code/Test_definitions/predictive-connectivity-data.feature @@ -1,490 +1,488 @@ Feature: CAMARA Predictive Connectivity Data API, v0.1 - # Input to be provided by the implementation to the tester - # - # Implementation indications: - # * Geohash precisions allowed - # * Min start and end date-times allowed - # * Max requested time period allowed - # * Network connectivity types allowed - # * Max and min height allowed - # * Include the signal strength allowed - # * Max size of the response(Combination of area, startTime, endTime, service level and precision requested) supported for a sync response - # * Max size of the response(Combination of area, startTime, endTime, service level and precision requested) supported for an async response - # * Limitations about max complexity of requested area allowed - # - # Testing assets: - # * An Area within the supported region - # * An Area partially within the supported region - # * An Area outside the supported region - # - # References to OAS spec schemas refer to schemas specified in predictive-connectivity-data.yaml - - Background: Common retrieveConnectivity setup - Given an environment at "apiRoot" - And the resource "/predictive-connectivity-data/v0.1/retrieve" - 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" complies with the schema at "#/components/schemas/XCorrelator" - And the request body is set by default to a request body compliant with the schema - - # Happy path scenarios - - @predictive_connectivity_data_01_supported_area_success_scenario - Scenario: Validate success response for a supported area request - Given the request body property "$.area" is set to a valid testing area within supported regions - And the request body property "$.startTime" is set to a valid testing date-time - And the request body property "$.endTime" is set to a valid testing date-time later than body property "$.startTime" - And the request body property "$.serviceLevel" is set to a valid communication service level - When the request "retrieveConnectivity" is sent - Then the response status code is 200 - And the response header "Content-Type" is "application/json" - And the response header "x-correlator" has same value as the request header "x-correlator" - And the response body complies with the OAS schema at "/components/schemas/ConnectivityDataResponse" - And the response property "$.status" value is "SUPPORTED_AREA" - And the response property "$.timedConnectivityData[*].startTime" is equal to or later than request body property "$.startTime" - And the response property "$.timedConnectivityData[*].endTime" is equal to or earlier than request body property "$.endTime" - And the response property "$.timedConnectivityData[*].cellConnectivityData[*].geohash" is a valid Geohash inside the request area - And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities" is not empty - And all the items in response property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities[*]" are equal to "GC", "MC" or "NC" - And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerSignalStrengths" is not included in the response - - @predictive_connectivity_data_02_partial_area_success_scenario - Scenario: Validate success response for a partial supported area request - Given the request body property "$.area" is set to a valid testing area partially within supported regions - And the request body property "$.startTime" is set to a valid testing future date-time - And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" - And the request body property "$.serviceLevel" is set to a valid communication service level - When the request "retrieveConnectivity" is sent - Then the response status code is 200 - And the response header "Content-Type" is "application/json" - And the response header "x-correlator" has same value as the request header "x-correlator" - And the response body complies with the OAS schema at "/components/schemas/ConnectivityDataResponse" - And the response property "$.status" value is "PART_OF_AREA_NOT_SUPPORTED" - And the response property "$.timedConnectivityData[*].startTime" is equal to or later than request body property "$.startTime" - And the response property "$.timedConnectivityData[*].endTime" is equal to or earlier than request body property "$.endTime" - And there is at least one item in response property "$.timedConnectivityData[*].cellConnectivityData[*]" with array property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities[*]" containing only "ND" values - And the response property "$.timedConnectivityData[*].cellConnectivityData[*].geohash" is a valid Geohash inside the request area - And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities" is not empty - And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerSignalStrengths" is not included in the response - - @predictive_connectivity_data_03_not_supported_area_success_scenario - Scenario: Validate success response for unsupported area request - Given the request body property "$.area" is set to a valid testing area outside supported regions - And the request body property "$.startTime" is set to a valid testing future date-time - And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" - And the request body property "$.serviceLevel" is set to a valid communication service level - When the request "retrieveConnectivity" is sent - Then the response status code is 200 - And the response header "Content-Type" is "application/json" - And the response header "x-correlator" has same value as the request header "x-correlator" - And the response body complies with the OAS schema at "/components/schemas/ConnectivityDataResponse" - And the response property "$.status" value is "AREA_NOT_SUPPORTED" - And the response property "$.timedConnectivityData" is an empty array - - @predictive_connectivity_data_04_async_success_scenario - Scenario: Validate success async response for a request when sink is provided - # Property "$.sink" is set with a valid public accessible HTTPs endpoint - Given the request body property "$.area" is set to a valid testing area within supported regions - And the request body property "$.startTime" is set to a valid testing future date-time - And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" - And the request body property "$.serviceLevel" is set to a valid communication service level - And the request body property "$.sink" is set to a valid HTTPS URL - And the request property "$.sinkCredential.credentialType" is set to "ACCESSTOKEN" - And the request property "$.sinkCredential.accessTokenType" is set to "bearer" - And the request property "$.sinkCredential.accessToken" is set to a valid access token accepted by the events receiver - And the request property "$.sinkCredential.accessTokenExpiresUtc" is set to a value long enough in the future - When the request "retrieveConnectivity" is sent - Then the response status 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 includes property "$.operationId" - And the request with the response body will be received at the address of the request property "$.sink" - And the request will have header "Authorization" set to "Bearer " + the value of the request property "$.sinkCredential.accessToken" - And the request will have property "$.operationId" equal to response property "$.operationId" - And the request body complies with the OAS schema at "/components/schemas/ConnectivityDataAsyncResponse" - - @predictive_connectivity_data_05_async_operation_not_completed_scenario - Scenario: Validate async callback when operation fails - # Property "$.sink" is set with a valid public accessible HTTPs endpoint - Given the request body property "$.area" is set to a valid testing area within supported regions - And the request body property "$.startTime" is set to a valid testing future date-time - And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" - And the request body property "$.serviceLevel" is set to a valid communication service level - And the request body property "$.sink" is set to a valid HTTPS URL - And the request property "$.sinkCredential.credentialType" is set to "ACCESSTOKEN" - And the request property "$.sinkCredential.accessTokenType" is set to "bearer" - And the request property "$.sinkCredential.accessToken" is set to a valid access token accepted by the events receiver - And the request property "$.sinkCredential.accessTokenExpiresUtc" is set to a value long enough in the future - When the request "retrieveConnectivity" is sent - Then the response status 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 includes property "$.operationId" - And there have been some problem processing the request asynchronously - And the request with the response body will be received at the address of the request property "$.sink" - And the request will have header "Authorization" set to "Bearer " + the value of the request property "$.sinkCredential.accessToken" - And the request will have property "$.operationId" equal to response property "$.operationId" - And the request body complies with the OAS schema at "/components/schemas/ConnectivityDataAsyncResponse" - And the request body will have property "$.status" equal to "OPERATION_NOT_COMPLETED" - And the callback request body will include property "$.statusInfo" - - @predictive_connectivity_data_06_custom_precision_success_scenario - Scenario: Validate success response for a request specifying the precision of the geohashes - Given the request body property "$.area" is set to a valid testing area within supported regions - And the request body property "$.startTime" is set to a valid testing future date-time - And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" - And the request body property "$.serviceLevel" is set to a valid communication service level - And the request body property "$.precision" is set to a valid precision for the geohash response cells - When the request "retrieveConnectivity" is sent - Then the response status code is 200 - And the response header "Content-Type" is "application/json" - And the response header "x-correlator" has same value as the request header "x-correlator" - And the response body complies with the OAS schema at "/components/schemas/ConnectivityDataResponse" - - @predictive_connectivity_data_07_concrete_network_type_success_scenario - Scenario: Validate success response for a request specifying the network type for which the connectivity data is to be obtained - Given the request body property "$.area" is set to a valid testing area within supported regions - And the request body property "$.startTime" is set to a valid testing future date-time - And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" - And the request body property "$.serviceLevel" is set to a valid communication service level - And the request body property "$.networkType" is set to a valid networkType - When the request "retrieveConnectivity" is sent - Then the response status code is 200 - And the response header "Content-Type" is "application/json" - And the response header "x-correlator" has same value as the request header "x-correlator" - And the response body complies with the OAS schema at "/components/schemas/ConnectivityDataResponse" - - @predictive_connectivity_data_08_concrete_height_success_scenario - Scenario: Validate success response for a request specifying the height for which the connectivity data is to be obtained - Given the request body property "$.area" is set to a valid testing area within supported regions - And the request body property "$.startTime" is set to a valid testing future date-time - And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" - And the request body property "$.serviceLevel" is set to a valid communication service level - And the request body property "$.height" is set to a valid height in metres above ground level - When the request "retrieveConnectivity" is sent - Then the response status code is 200 - And the response header "Content-Type" is "application/json" - And the response header "x-correlator" has same value as the request header "x-correlator" - And the response body complies with the OAS schema at "/components/schemas/ConnectivityDataResponse" - And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities[*]" has only 1 item, corresponding to the layer containing the requested height - And the response property "$.requestedHeight" is equal to the request property "$.height" - - # If signal strength is not supported by the implementation this scenario will not apply. Therefore the request body property "$.includeSignalStrength" will be ignored and only connectivity quality will be returned. - @predictive_connectivity_data_09_include_signal_strength - Scenario: Validate success response for a request including signal strength - Given the request body property "$.area" is set to a valid testing area within supported regions - And the request body property "$.startTime" is set to a valid testing date-time - And the request body property "$.endTime" is set to a valid testing date-time later than body property "$.startTime" - And the request body property "$.serviceLevel" is set to a valid communication service level - And the request body property "$.includeSignalStrength" is set to true - When the request "retrieveConnectivity" is sent - Then the response status code is 200 - And the response header "Content-Type" is "application/json" - And the response header "x-correlator" has same value as the request header "x-correlator" - And the response body complies with the OAS schema at "/components/schemas/ConnectivityDataResponse" - And the response property "$.status" value is "SUPPORTED_AREA" - And the response property "$.timedConnectivityData[*].startTime" is equal to or later than request body property "$.startTime" - And the response property "$.timedConnectivityData[*].endTime" is equal to or earlier than request body property "$.endTime" - And the response property "$.timedConnectivityData[*].cellConnectivityData[*].geohash" is a valid Geohash inside the request area - And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities[*]" is not empty - And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerSignalStrengths[*]" has the same length as "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities[*]" - - @predictive_connectivity_data_10_supported_area_past_success_scenario - Scenario: Validate success response for a supported area request - Given the request body property "$.area" is set to a valid testing area within supported regions - And the request body property "$.startTime" is set to a valid testing date-time in the past - And the request body property "$.endTime" is set to a valid testing past date-time later than body property "$.startTime" - And the request body property "$.serviceLevel" is set to a valid communication service level - When the request "retrieveConnectivity" is sent - Then the response status code is 200 - And the response header "Content-Type" is "application/json" - And the response header "x-correlator" has same value as the request header "x-correlator" - And the response body complies with the OAS schema at "/components/schemas/ConnectivityDataResponse" - And the response property "$.status" value is "SUPPORTED_AREA" - And the response property "$.timedConnectivityData[*].startTime" is equal to or later than request body property "$.startTime" - And the response property "$.timedConnectivityData[*].endTime" is equal to or earlier than request body property "$.endTime" - And the response property "$.timedConnectivityData[*].cellConnectivityData[*].geohash" is a valid Geohash inside the request area - And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities" is not empty - And all the items in response property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities[*]" are equal to "GC", "MC" or "NC" - And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerSignalStrengths" is not included in the response - - # Error scenarios - - # Error 400 scenarios - - @predictive_connectivity_data_400.01_missing_required_property - Scenario Outline: Error response for missing required property in request body - Given the request body property "" is not included - When the request "retrieveConnectivity" is sent - Then the response status code is 400 - And the response header "Content-Type" is "application/json" - 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 - - Examples: - | required_property | - | $.area | - | $.startTime | - | $.endTime | - | $.serviceLevel | - - @predictive_connectivity_data_400.02_invalid_date_format - Scenario Outline: Error 400 when the datetime format is not RFC-3339 - Given the request body property "" is not set to a valid RFC-3339 date-time - When the request "retrieveConnectivity" is sent - Then the response status code is 400 - And the response header "Content-Type" is "application/json" - 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 - - Examples: - | date_property | - | $.startTime | - | $.endTime | - - @predictive_connectivity_data_400.03_invalid_service_level - Scenario: Error 400 when serviceLevel has not a valid value - Given the request body property "$.serviceLevel" is not set to "C2" or "STREAM_4K" - When the request "retrieveConnectivity" is sent - Then the response status code is 400 - And the response header "Content-Type" is "application/json" - 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 - - @predictive_connectivity_data_400.04_invalid_precision - Scenario: Error 400 when precision is not a number between 1 and 12 - Given the request body property "$.precision" is not set to a number between 1 and 12 - When the request "retrieveConnectivity" is sent - Then the response status code is 400 - And the response header "Content-Type" is "application/json" - 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 - - @predictive_connectivity_data_400.05_invalid_network_type - Scenario: Error 400 when networkType has not a valid value - Given the request body property "$.networkType" is not set to a "4G" or "5G" - When the request "retrieveConnectivity" is sent - Then the response status code is 400 - And the response header "Content-Type" is "application/json" - 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 - - @predictive_connectivity_data_400.06_invalid_height - Scenario: Error 400 when height is not a number between 0 and 250 - Given the request body property "$.height" is not set to a number between 0 and 250 - When the request "retrieveConnectivity" is sent - Then the response status code is 400 - And the response header "Content-Type" is "application/json" - 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 - - # PLAIN and REFRESHTOKEN are considered in the schema so INVALID_ARGUMENT is not expected - @predictive_connectivity_data_400.07_invalid_sink_credential - Scenario: Invalid credential - Given the request body property "$.sinkCredential.credentialType" is not set to "ACCESSTOKEN" - When the request "retrieveConnectivity" is sent - Then the response status code is 400 - And the response header "x-correlator" has same value as the request header "x-correlator" - And the response header "Content-Type" is "application/json" - And the response property "$.status" is 400 - And the response property "$.code" is "INVALID_CREDENTIAL" - And the response property "$.message" contains a user friendly text - - # Only "bearer" is considered in the schema so a generic schema validator may fail and generate a 400 INVALID_ARGUMENT without further distinction, - # and both could be accepted - @predictive_connectivity_data_400.08_sink_credential_invalid_token - Scenario: Invalid token - Given the request body property "$.sinkCredential.accessTokenType" is set to a value other than "bearer" - When the request "retrieveConnectivity" is sent - Then the response status code is 400 - And the response header "x-correlator" has same value as the request header "x-correlator" - And the response header "Content-Type" is "application/json" - And the response property "$.status" is 400 - And the response property "$.code" is "INVALID_TOKEN" or "INVALID_ARGUMENT" - And the response property "$.message" contains a user friendly text - - @predictive_connectivity_data_400.09_invalid_url - Scenario: Invalid sink - Given the request body property "$.sink" is not set to an url - When the request "retrieveConnectivity" is sent - Then the response status code is 400 - And the response header "x-correlator" has same value as the request header "x-correlator" - And the response header "Content-Type" is "application/json" - And the response property "$.status" is 400 - And the response property "$.code" is "INVALID_SINK" - And the response property "$.message" contains a user friendly text - - # An area that does not form a polygon is a straight line or a set of points with same coordinates. - @predictive_connectivity_data_400.10_non_polygonal_area - Scenario: Error 400 when the requested area is not a polygon - Given the request body property "$.area.boundary" is set to an array of coordinates that does not form a polygon - When the request "retrieveConnectivity" is sent - Then the response status code is 400 - And the response header "Content-Type" is "application/json" - And the response property "$.status" is 400 - And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.INVALID_AREA" - And the response property "$.message" contains a user friendly text - - @predictive_connectivity_data_400.11_too_complex_area - Scenario: Error 400 when the requested area is too complex - Given the request body property "$.area.boundary" is set to an array of coordinates that form a too complex area - When the request "retrieveConnectivity" is sent - Then the response status code is 400 - And the response header "Content-Type" is "application/json" - And the response property "$.status" is 400 - And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.INVALID_AREA" - And the response property "$.message" contains a user friendly text - - @predictive_connectivity_data_400.12_min_start_time_exceeded - Scenario: Error 400 when startTime is set to a date-time earlier than the minimum allowed - Given the request body property "$.startTime" is set to a date-time earlier than the minimum allowed - When the request "retrieveConnectivity" is sent - Then the response status code is 400 - And the response header "Content-Type" is "application/json" - And the response property "$.status" is 400 - And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.MIN_STARTTIME_EXCEEDED" - And the response property "$.message" contains a user friendly text - - @predictive_connectivity_data_400.13_max_start_time_exceeded - Scenario: Error 400 when startTime is set to a date-time later than the maximum allowed - Given the request body property "$.startTime" is set to a date-time later than the maximum allowed - When the request "retrieveConnectivity" is sent - Then the response status code is 400 - And the response header "Content-Type" is "application/json" - And the response property "$.status" is 400 - And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.MAX_STARTTIME_EXCEEDED" - And the response property "$.message" contains a user friendly text - - @predictive_connectivity_data_400.14_invalid_end_time - Scenario: Error 400 when endTime is set to a date-time earlier than startTime - Given the request body property "$.endTime" is set to a date-time earlier than request body property "$.startTime" - When the request "retrieveConnectivity" is sent - Then the response status code is 400 - And the response header "Content-Type" is "application/json" - And the response property "$.status" is 400 - And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.INVALID_END_TIME" - And the response property "$.message" contains a user friendly text - - @predictive_connectivity_data_400.15_max_time_period_exceeded - Scenario: Error 400 when indicated date-time period is greater than the maximum allowed - Given the request body property "$.startTime" is set to a valid testing future date-time - And the request body property "$.endTime" is set to a future date-time that exceeds the supported duration from the start time. - When the request "retrieveConnectivity" is sent - Then the response status code is 400 - And the response header "Content-Type" is "application/json" - And the response property "$.status" is 400 - And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.MAX_TIME_PERIOD_EXCEEDED" - And the response property "$.message" contains a user friendly text - - @predictive_connectivity_data_400.16_timeframe_crosses_request_time - Scenario: Error 400 when startTime is set to a date-time in the past and the endTime is set to a date-time in the future - Given the request body property "$.startTime" is set to a date-time in the past - And the request body property "$.endTime" is set to a date-time in the future - When the request "retrieveConnectivity" is sent - Then the response status code is 400 - And the response header "Content-Type" is "application/json" - And the response property "$.status" is 400 - And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.INVALID_TIME_PERIOD" - And the response property "$.message" contains a user friendly text - - # Error 401 scenarios - - @predictive_connectivity_data_401.01_expired_access_token - Scenario: Error response for expired access token - Given an expired access token - And the request body is set to a valid request body - When the request "retrieveConnectivity" 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 - - @predictive_connectivity_data_401.02_invalid_access_token - Scenario: Error response for invalid access token - Given an invalid access token - And the request body is set to a valid request body - When the request "retrieveConnectivity" 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 - - @predictive_connectivity_data_401.03_missing_authorization_header - Scenario: Error response for no header "Authorization" - Given the header "Authorization" is not sent - And the request body is set to a valid request body - When the request "retrieveConnectivity" 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 - - # Error 403 scenarios - - @predictive_connectivity_data_403.01_invalid_token_permissions - Scenario: Error response for invalid access token permissions - # To test this scenario, it will be necessary to obtain a token without the required scope - Given the header "Authorization" is set to an access token without the required scope - And the request body is set to a valid request body - When the request "retrieveConnectivity" is sent - Then the response status code is 403 - And the response header "Content-Type" is "application/json" - 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 - - # Error 422 scenarios - - @predictive_connectivity_data_422.01_unsupported_precision - Scenario: Error 422 when precision is set to a valid but not supported value - Given the request body property "$.precision" is set to a valid but not supported value - When the request "retrieveConnectivity" is sent - Then the response status code is 422 - And the response header "Content-Type" is "application/json" - And the response property "$.status" is 422 - And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.UNSUPPORTED_PRECISION" - And the response property "$.message" contains a user friendly text - - @predictive_connectivity_data_422.02_too_big_synchronous_response - Scenario: Error 422 when the response is too big for a sync response - Given the request body properties "$.area.boundary", "$.startTime", "$.endTime" and "$.precision" are set to valid values but generate a response too big for a synchronous response - When the request "retrieveConnectivity" is sent - Then the response status code is 422 - And the response header "Content-Type" is "application/json" - And the response property "$.status" is 422 - And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.UNSUPPORTED_SYNC_RESPONSE" - And the response property "$.message" contains a user friendly text - - @predictive_connectivity_data_422.03_too_big_request - Scenario: Error 422 when the response is too big for a sync and async response - Given the request body properties "$.area.boundary", "$.startTime", "$.endTime" and "$.precision" are set to valid values but generate a response too big for a synchronous and asynchronous response - When the request "retrieveConnectivity" is sent - Then the response status code is 422 - And the response header "Content-Type" is "application/json" - And the response property "$.status" is 422 - And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.UNSUPPORTED_REQUEST" - And the response property "$.message" contains a user friendly text + # Input to be provided by the implementation to the tester + # + # Implementation indications: + # * Geohash precisions allowed + # * Min start and end date-times allowed + # * Max requested time period allowed + # * Network connectivity types allowed + # * Max and min height allowed + # * Include the signal strength allowed + # * Max size of the response(Combination of area, startTime, endTime, service level and precision requested) supported for a sync response + # * Max size of the response(Combination of area, startTime, endTime, service level and precision requested) supported for an async response + # * Limitations about max complexity of requested area allowed + # + # Testing assets: + # * An Area within the supported region + # * An Area partially within the supported region + # * An Area outside the supported region + # + # References to OAS spec schemas refer to schemas specified in predictive-connectivity-data.yaml + + Background: Common retrieveConnectivity setup + Given an environment at "apiRoot" + And the resource "/predictive-connectivity-data/v0.1/retrieve" + 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" complies with the schema at "#/components/schemas/XCorrelator" + And the request body is set by default to a request body compliant with the schema + + # Happy path scenarios + + @predictive_connectivity_data_01_supported_area_success_scenario + Scenario: Validate success response for a supported area request + Given the request body property "$.area" is set to a valid testing area within supported regions + And the request body property "$.startTime" is set to a valid testing date-time + And the request body property "$.endTime" is set to a valid testing date-time later than body property "$.startTime" + And the request body property "$.serviceLevel" is set to a valid communication service level + When the request "retrieveConnectivity" is sent + Then the response status code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "/components/schemas/ConnectivityDataResponse" + And the response property "$.status" value is "SUPPORTED_AREA" + And the response property "$.timedConnectivityData[*].startTime" is equal to or later than request body property "$.startTime" + And the response property "$.timedConnectivityData[*].endTime" is equal to or earlier than request body property "$.endTime" + And the response property "$.timedConnectivityData[*].cellConnectivityData[*].geohash" is a valid Geohash inside the request area + And all the items in response property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities[*]" are equal to "GC", "MC" or "NC" + And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerSignalStrengths" is not included in the response + + @predictive_connectivity_data_02_partial_area_success_scenario + Scenario: Validate success response for a partial supported area request + Given the request body property "$.area" is set to a valid testing area partially within supported regions + And the request body property "$.startTime" is set to a valid testing future date-time + And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" + And the request body property "$.serviceLevel" is set to a valid communication service level + When the request "retrieveConnectivity" is sent + Then the response status code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "/components/schemas/ConnectivityDataResponse" + And the response property "$.status" value is "PART_OF_AREA_NOT_SUPPORTED" + And the response property "$.timedConnectivityData[*].startTime" is equal to or later than request body property "$.startTime" + And the response property "$.timedConnectivityData[*].endTime" is equal to or earlier than request body property "$.endTime" + And there is at least one item in response property "$.timedConnectivityData[*].cellConnectivityData[*]" with array property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities[*]" containing only "ND" values + And the response property "$.timedConnectivityData[*].cellConnectivityData[*].geohash" is a valid Geohash inside the request area + And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities" is not empty + And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerSignalStrengths" is not included in the response + + @predictive_connectivity_data_03_not_supported_area_success_scenario + Scenario: Validate success response for unsupported area request + Given the request body property "$.area" is set to a valid testing area outside supported regions + And the request body property "$.startTime" is set to a valid testing future date-time + And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" + And the request body property "$.serviceLevel" is set to a valid communication service level + When the request "retrieveConnectivity" is sent + Then the response status code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "/components/schemas/ConnectivityDataResponse" + And the response property "$.status" value is "AREA_NOT_SUPPORTED" + And the response property "$.timedConnectivityData" is an empty array + + @predictive_connectivity_data_04_async_success_scenario + Scenario: Validate success async response for a request when sink is provided + # Property "$.sink" is set with a valid public accessible HTTPs endpoint + Given the request body property "$.area" is set to a valid testing area within supported regions + And the request body property "$.startTime" is set to a valid testing future date-time + And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" + And the request body property "$.serviceLevel" is set to a valid communication service level + And the request body property "$.sink" is set to a valid HTTPS URL + And the request property "$.sinkCredential.credentialType" is set to "ACCESSTOKEN" + And the request property "$.sinkCredential.accessTokenType" is set to "bearer" + And the request property "$.sinkCredential.accessToken" is set to a valid access token accepted by the events receiver + And the request property "$.sinkCredential.accessTokenExpiresUtc" is set to a value long enough in the future + When the request "retrieveConnectivity" is sent + Then the response status 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 includes property "$.operationId" + And the request with the response body will be received at the address of the request property "$.sink" + And the request will have header "Authorization" set to "Bearer " + the value of the request property "$.sinkCredential.accessToken" + And the request will have property "$.operationId" equal to response property "$.operationId" + And the request body complies with the OAS schema at "/components/schemas/ConnectivityDataAsyncResponse" + + @predictive_connectivity_data_05_async_operation_not_completed_scenario + Scenario: Validate async callback when operation fails + # Property "$.sink" is set with a valid public accessible HTTPs endpoint + Given the request body property "$.area" is set to a valid testing area within supported regions + And the request body property "$.startTime" is set to a valid testing future date-time + And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" + And the request body property "$.serviceLevel" is set to a valid communication service level + And the request body property "$.sink" is set to a valid HTTPS URL + And the request property "$.sinkCredential.credentialType" is set to "ACCESSTOKEN" + And the request property "$.sinkCredential.accessTokenType" is set to "bearer" + And the request property "$.sinkCredential.accessToken" is set to a valid access token accepted by the events receiver + And the request property "$.sinkCredential.accessTokenExpiresUtc" is set to a value long enough in the future + When the request "retrieveConnectivity" is sent + Then the response status 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 includes property "$.operationId" + And there have been some problem processing the request asynchronously + And the request with the response body will be received at the address of the request property "$.sink" + And the request will have header "Authorization" set to "Bearer " + the value of the request property "$.sinkCredential.accessToken" + And the request will have property "$.operationId" equal to response property "$.operationId" + And the request body complies with the OAS schema at "/components/schemas/ConnectivityDataAsyncResponse" + And the request body will have property "$.status" equal to "OPERATION_NOT_COMPLETED" + And the callback request body will include property "$.statusInfo" + + @predictive_connectivity_data_06_custom_precision_success_scenario + Scenario: Validate success response for a request specifying the precision of the geohashes + Given the request body property "$.area" is set to a valid testing area within supported regions + And the request body property "$.startTime" is set to a valid testing future date-time + And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" + And the request body property "$.serviceLevel" is set to a valid communication service level + And the request body property "$.precision" is set to a valid precision for the geohash response cells + When the request "retrieveConnectivity" is sent + Then the response status code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "/components/schemas/ConnectivityDataResponse" + + @predictive_connectivity_data_07_concrete_network_type_success_scenario + Scenario: Validate success response for a request specifying the network type for which the connectivity data is to be obtained + Given the request body property "$.area" is set to a valid testing area within supported regions + And the request body property "$.startTime" is set to a valid testing future date-time + And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" + And the request body property "$.serviceLevel" is set to a valid communication service level + And the request body property "$.networkType" is set to a valid networkType + When the request "retrieveConnectivity" is sent + Then the response status code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "/components/schemas/ConnectivityDataResponse" + + @predictive_connectivity_data_08_concrete_height_success_scenario + Scenario: Validate success response for a request specifying the height for which the connectivity data is to be obtained + Given the request body property "$.area" is set to a valid testing area within supported regions + And the request body property "$.startTime" is set to a valid testing future date-time + And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" + And the request body property "$.serviceLevel" is set to a valid communication service level + And the request body property "$.height" is set to a valid height in metres above ground level + When the request "retrieveConnectivity" is sent + Then the response status code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "/components/schemas/ConnectivityDataResponse" + And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities[*]" has only 1 item, corresponding to the layer containing the requested height + And the response property "$.requestedHeight" is equal to the request property "$.height" + + # If signal strength is not supported by the implementation this scenario will not apply. Therefore the request body property "$.includeSignalStrength" will be ignored and only connectivity quality will be returned. + @predictive_connectivity_data_09_include_signal_strength + Scenario: Validate success response for a request including signal strength + Given the request body property "$.area" is set to a valid testing area within supported regions + And the request body property "$.startTime" is set to a valid testing date-time + And the request body property "$.endTime" is set to a valid testing date-time later than body property "$.startTime" + And the request body property "$.serviceLevel" is set to a valid communication service level + And the request body property "$.includeSignalStrength" is set to true + When the request "retrieveConnectivity" is sent + Then the response status code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "/components/schemas/ConnectivityDataResponse" + And the response property "$.status" value is "SUPPORTED_AREA" + And the response property "$.timedConnectivityData[*].startTime" is equal to or later than request body property "$.startTime" + And the response property "$.timedConnectivityData[*].endTime" is equal to or earlier than request body property "$.endTime" + And the response property "$.timedConnectivityData[*].cellConnectivityData[*].geohash" is a valid Geohash inside the request area + And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities[*]" is not empty + And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerSignalStrengths[*]" has the same length as "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities[*]" + + @predictive_connectivity_data_10_supported_area_past_success_scenario + Scenario: Validate success response for a supported area in a past time period request + Given the request body property "$.area" is set to a valid testing area within supported regions + And the request body property "$.startTime" is set to a valid testing date-time in the past + And the request body property "$.endTime" is set to a valid testing past date-time later than body property "$.startTime" + And the request body property "$.serviceLevel" is set to a valid communication service level + When the request "retrieveConnectivity" is sent + Then the response status code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "/components/schemas/ConnectivityDataResponse" + And the response property "$.status" value is "SUPPORTED_AREA" + And the response property "$.timedConnectivityData[*].startTime" is equal to or later than request body property "$.startTime" + And the response property "$.timedConnectivityData[*].endTime" is equal to or earlier than request body property "$.endTime" + And the response property "$.timedConnectivityData[*].cellConnectivityData[*].geohash" is a valid Geohash inside the request area + And all the items in response property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities[*]" are equal to "GC", "MC" or "NC" + And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerSignalStrengths" is not included in the response + + # Error scenarios + + # Error 400 scenarios + + @predictive_connectivity_data_400.01_missing_required_property + Scenario Outline: Error response for missing required property in request body + Given the request body property "" is not included + When the request "retrieveConnectivity" is sent + Then the response status code is 400 + And the response header "Content-Type" is "application/json" + 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 + + Examples: + | required_property | + | $.area | + | $.startTime | + | $.endTime | + | $.serviceLevel | + + @predictive_connectivity_data_400.02_invalid_date_format + Scenario Outline: Error 400 when the datetime format is not RFC-3339 + Given the request body property "" is not set to a valid RFC-3339 date-time + When the request "retrieveConnectivity" is sent + Then the response status code is 400 + And the response header "Content-Type" is "application/json" + 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 + + Examples: + | date_property | + | $.startTime | + | $.endTime | + + @predictive_connectivity_data_400.03_invalid_service_level + Scenario: Error 400 when serviceLevel has not a valid value + Given the request body property "$.serviceLevel" is not set to "C2" or "STREAM_4K" + When the request "retrieveConnectivity" is sent + Then the response status code is 400 + And the response header "Content-Type" is "application/json" + 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 + + @predictive_connectivity_data_400.04_invalid_precision + Scenario: Error 400 when precision is not a number between 1 and 12 + Given the request body property "$.precision" is not set to a number between 1 and 12 + When the request "retrieveConnectivity" is sent + Then the response status code is 400 + And the response header "Content-Type" is "application/json" + 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 + + @predictive_connectivity_data_400.05_invalid_network_type + Scenario: Error 400 when networkType has not a valid value + Given the request body property "$.networkType" is not set to a "4G" or "5G" + When the request "retrieveConnectivity" is sent + Then the response status code is 400 + And the response header "Content-Type" is "application/json" + 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 + + @predictive_connectivity_data_400.06_invalid_height + Scenario: Error 400 when height is not a number between 0 and 250 + Given the request body property "$.height" is not set to a number between 0 and 250 + When the request "retrieveConnectivity" is sent + Then the response status code is 400 + And the response header "Content-Type" is "application/json" + 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 + + # PLAIN and REFRESHTOKEN are considered in the schema so INVALID_ARGUMENT is not expected + @predictive_connectivity_data_400.07_invalid_sink_credential + Scenario: Invalid credential + Given the request body property "$.sinkCredential.credentialType" is not set to "ACCESSTOKEN" + When the request "retrieveConnectivity" is sent + Then the response status code is 400 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_CREDENTIAL" + And the response property "$.message" contains a user friendly text + + # Only "bearer" is considered in the schema so a generic schema validator may fail and generate a 400 INVALID_ARGUMENT without further distinction, + # and both could be accepted + @predictive_connectivity_data_400.08_sink_credential_invalid_token + Scenario: Invalid token + Given the request body property "$.sinkCredential.accessTokenType" is set to a value other than "bearer" + When the request "retrieveConnectivity" is sent + Then the response status code is 400 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_TOKEN" or "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text + + @predictive_connectivity_data_400.09_invalid_url + Scenario: Invalid sink + Given the request body property "$.sink" is not set to an url + When the request "retrieveConnectivity" is sent + Then the response status code is 400 + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_SINK" + And the response property "$.message" contains a user friendly text + + # An area that does not form a polygon is a straight line or a set of points with same coordinates. + @predictive_connectivity_data_400.10_non_polygonal_area + Scenario: Error 400 when the requested area is not a polygon + Given the request body property "$.area.boundary" is set to an array of coordinates that does not form a polygon + When the request "retrieveConnectivity" is sent + Then the response status code is 400 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.INVALID_AREA" + And the response property "$.message" contains a user friendly text + + @predictive_connectivity_data_400.11_too_complex_area + Scenario: Error 400 when the requested area is too complex + Given the request body property "$.area.boundary" is set to an array of coordinates that form a too complex area + When the request "retrieveConnectivity" is sent + Then the response status code is 400 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.INVALID_AREA" + And the response property "$.message" contains a user friendly text + + @predictive_connectivity_data_400.12_min_start_time_exceeded + Scenario: Error 400 when startTime is set to a date-time earlier than the minimum allowed + Given the request body property "$.startTime" is set to a date-time earlier than the minimum allowed + When the request "retrieveConnectivity" is sent + Then the response status code is 400 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.MIN_STARTTIME_EXCEEDED" + And the response property "$.message" contains a user friendly text + + @predictive_connectivity_data_400.13_max_start_time_exceeded + Scenario: Error 400 when startTime is set to a date-time later than the maximum allowed + Given the request body property "$.startTime" is set to a date-time later than the maximum allowed + When the request "retrieveConnectivity" is sent + Then the response status code is 400 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.MAX_STARTTIME_EXCEEDED" + And the response property "$.message" contains a user friendly text + + @predictive_connectivity_data_400.14_invalid_end_time + Scenario: Error 400 when endTime is set to a date-time earlier than startTime + Given the request body property "$.endTime" is set to a date-time earlier than request body property "$.startTime" + When the request "retrieveConnectivity" is sent + Then the response status code is 400 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.INVALID_END_TIME" + And the response property "$.message" contains a user friendly text + + @predictive_connectivity_data_400.15_max_time_period_exceeded + Scenario: Error 400 when indicated date-time period is greater than the maximum allowed + Given the request body property "$.startTime" is set to a valid testing future date-time + And the request body property "$.endTime" is set to a future date-time that exceeds the supported duration from the start time. + When the request "retrieveConnectivity" is sent + Then the response status code is 400 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.MAX_TIME_PERIOD_EXCEEDED" + And the response property "$.message" contains a user friendly text + + @predictive_connectivity_data_400.16_timeframe_crosses_request_time + Scenario: Error 400 when startTime is set to a date-time in the past and the endTime is set to a date-time in the future + Given the request body property "$.startTime" is set to a date-time in the past + And the request body property "$.endTime" is set to a date-time in the future + When the request "retrieveConnectivity" is sent + Then the response status code is 400 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.INVALID_TIME_PERIOD" + And the response property "$.message" contains a user friendly text + + # Error 401 scenarios + + @predictive_connectivity_data_401.01_expired_access_token + Scenario: Error response for expired access token + Given an expired access token + And the request body is set to a valid request body + When the request "retrieveConnectivity" 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 + + @predictive_connectivity_data_401.02_invalid_access_token + Scenario: Error response for invalid access token + Given an invalid access token + And the request body is set to a valid request body + When the request "retrieveConnectivity" 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 + + @predictive_connectivity_data_401.03_missing_authorization_header + Scenario: Error response for no header "Authorization" + Given the header "Authorization" is not sent + And the request body is set to a valid request body + When the request "retrieveConnectivity" 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 + + # Error 403 scenarios + + @predictive_connectivity_data_403.01_invalid_token_permissions + Scenario: Error response for invalid access token permissions + # To test this scenario, it will be necessary to obtain a token without the required scope + Given the header "Authorization" is set to an access token without the required scope + And the request body is set to a valid request body + When the request "retrieveConnectivity" is sent + Then the response status code is 403 + And the response header "Content-Type" is "application/json" + 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 + + # Error 422 scenarios + + @predictive_connectivity_data_422.01_unsupported_precision + Scenario: Error 422 when precision is set to a valid but not supported value + Given the request body property "$.precision" is set to a valid but not supported value + When the request "retrieveConnectivity" is sent + Then the response status code is 422 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 422 + And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.UNSUPPORTED_PRECISION" + And the response property "$.message" contains a user friendly text + + @predictive_connectivity_data_422.02_too_big_synchronous_response + Scenario: Error 422 when the response is too big for a sync response + Given the request body properties "$.area.boundary", "$.startTime", "$.endTime" and "$.precision" are set to valid values but generate a response too big for a synchronous response + When the request "retrieveConnectivity" is sent + Then the response status code is 422 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 422 + And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.UNSUPPORTED_SYNC_RESPONSE" + And the response property "$.message" contains a user friendly text + + @predictive_connectivity_data_422.03_too_big_request + Scenario: Error 422 when the response is too big for a sync and async response + Given the request body properties "$.area.boundary", "$.startTime", "$.endTime" and "$.precision" are set to valid values but generate a response too big for a synchronous and asynchronous response + When the request "retrieveConnectivity" is sent + Then the response status code is 422 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 422 + And the response property "$.code" is "PREDICTIVE_CONNECTIVITY_DATA.UNSUPPORTED_REQUEST" + And the response property "$.message" contains a user friendly text # Error 429 scenarios - @predictive_connectivity_data_429.01_too_Many_Requests + @predictive_connectivity_data_429.01_too_Many_Requests #To test this scenario environment has to be configured to reject requests reaching the limit settled. N is a value defined by the Telco Operator - Scenario: Request is rejected due to threshold policy - Given that the environment is configured with a threshold policy of N transactions per second - And the request body is set to a valid request body - And the header "Authorization" is set to a valid access token - And the threshold of requests has been reached - When the request "retrieveConnectivity" is sent - Then the response status code is 429 - And the response property "$.status" is 429 - And the response property "$.code" is "TOO_MANY_REQUESTS" - And the response property "$.message" contains a user friendly text \ No newline at end of file + Scenario: Request is rejected due to threshold policy + Given that the environment is configured with a threshold policy of N transactions per second + And the request body is set to a valid request body + And the header "Authorization" is set to a valid access token + And the threshold of requests has been reached + When the request "retrieveConnectivity" is sent + Then the response status code is 429 + And the response property "$.status" is 429 + And the response property "$.code" is "TOO_MANY_REQUESTS" + And the response property "$.message" contains a user friendly text From 355efa5f72d5825bf25c5364fd494c537710464c Mon Sep 17 00:00:00 2001 From: Alberto Ramos Monagas Date: Thu, 21 Aug 2025 13:12:50 +0200 Subject: [PATCH 4/7] new line character at the end of file --- code/API_definitions/predictive-connectivity-data.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/API_definitions/predictive-connectivity-data.yaml b/code/API_definitions/predictive-connectivity-data.yaml index 43c718a..28c82b3 100644 --- a/code/API_definitions/predictive-connectivity-data.yaml +++ b/code/API_definitions/predictive-connectivity-data.yaml @@ -1260,4 +1260,5 @@ components: layerConnectivities: - GC status: SUPPORTED_AREA - requestedHeight: 50 \ No newline at end of file + requestedHeight: 50 + \ No newline at end of file From 081fe90f05009a75fa8a110015e88df39dac10fc Mon Sep 17 00:00:00 2001 From: Alberto Ramos Monagas Date: Thu, 21 Aug 2025 13:19:22 +0200 Subject: [PATCH 5/7] new line character at the end of file --- code/API_definitions/predictive-connectivity-data.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/code/API_definitions/predictive-connectivity-data.yaml b/code/API_definitions/predictive-connectivity-data.yaml index 28c82b3..922c106 100644 --- a/code/API_definitions/predictive-connectivity-data.yaml +++ b/code/API_definitions/predictive-connectivity-data.yaml @@ -1261,4 +1261,3 @@ components: - GC status: SUPPORTED_AREA requestedHeight: 50 - \ No newline at end of file From e91b012b80157731c437651d80f8a91e8309e75f Mon Sep 17 00:00:00 2001 From: Alberto Ramos Monagas Date: Thu, 28 Aug 2025 13:33:27 +0200 Subject: [PATCH 6/7] fix: solve problems related with scenario-size and name-lenght --- .../predictive-connectivity-data.feature | 65 +++++++------------ 1 file changed, 22 insertions(+), 43 deletions(-) diff --git a/code/Test_definitions/predictive-connectivity-data.feature b/code/Test_definitions/predictive-connectivity-data.feature index 922bbe9..65bd3ba 100644 --- a/code/Test_definitions/predictive-connectivity-data.feature +++ b/code/Test_definitions/predictive-connectivity-data.feature @@ -32,8 +32,7 @@ Feature: CAMARA Predictive Connectivity Data API, v0.1 @predictive_connectivity_data_01_supported_area_success_scenario Scenario: Validate success response for a supported area request Given the request body property "$.area" is set to a valid testing area within supported regions - And the request body property "$.startTime" is set to a valid testing date-time - And the request body property "$.endTime" is set to a valid testing date-time later than body property "$.startTime" + And the request body properties "$.startTime" and "$.endTime" are valid future date-times, with "$.endTime" later than "$.startTime" And the request body property "$.serviceLevel" is set to a valid communication service level When the request "retrieveConnectivity" is sent Then the response status code is 200 @@ -50,8 +49,7 @@ Feature: CAMARA Predictive Connectivity Data API, v0.1 @predictive_connectivity_data_02_partial_area_success_scenario Scenario: Validate success response for a partial supported area request Given the request body property "$.area" is set to a valid testing area partially within supported regions - And the request body property "$.startTime" is set to a valid testing future date-time - And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" + And the request body properties "$.startTime" and "$.endTime" are valid future date-times, with "$.endTime" later than "$.startTime" And the request body property "$.serviceLevel" is set to a valid communication service level When the request "retrieveConnectivity" is sent Then the response status code is 200 @@ -61,16 +59,15 @@ Feature: CAMARA Predictive Connectivity Data API, v0.1 And the response property "$.status" value is "PART_OF_AREA_NOT_SUPPORTED" And the response property "$.timedConnectivityData[*].startTime" is equal to or later than request body property "$.startTime" And the response property "$.timedConnectivityData[*].endTime" is equal to or earlier than request body property "$.endTime" - And there is at least one item in response property "$.timedConnectivityData[*].cellConnectivityData[*]" with array property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities[*]" containing only "ND" values - And the response property "$.timedConnectivityData[*].cellConnectivityData[*].geohash" is a valid Geohash inside the request area + And there is at least one item in response property "$.timedConnectivityData[*].cellConnectivityData[*]" + And that item has an array property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities[*]" containing only "ND" values And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities" is not empty And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerSignalStrengths" is not included in the response @predictive_connectivity_data_03_not_supported_area_success_scenario Scenario: Validate success response for unsupported area request Given the request body property "$.area" is set to a valid testing area outside supported regions - And the request body property "$.startTime" is set to a valid testing future date-time - And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" + And the request body properties "$.startTime" and "$.endTime" are valid future date-times, with "$.endTime" later than "$.startTime" And the request body property "$.serviceLevel" is set to a valid communication service level When the request "retrieveConnectivity" is sent Then the response status code is 200 @@ -84,54 +81,42 @@ Feature: CAMARA Predictive Connectivity Data API, v0.1 Scenario: Validate success async response for a request when sink is provided # Property "$.sink" is set with a valid public accessible HTTPs endpoint Given the request body property "$.area" is set to a valid testing area within supported regions - And the request body property "$.startTime" is set to a valid testing future date-time - And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" + And the request body properties "$.startTime" and "$.endTime" are valid future date-times, with "$.endTime" later than "$.startTime" And the request body property "$.serviceLevel" is set to a valid communication service level And the request body property "$.sink" is set to a valid HTTPS URL - And the request property "$.sinkCredential.credentialType" is set to "ACCESSTOKEN" - And the request property "$.sinkCredential.accessTokenType" is set to "bearer" - And the request property "$.sinkCredential.accessToken" is set to a valid access token accepted by the events receiver - And the request property "$.sinkCredential.accessTokenExpiresUtc" is set to a value long enough in the future + And the request body property "$.sinkCredential" is set to a valid credential with property "$.sinkCredential.credentialType" set to "ACCESSTOKEN" When the request "retrieveConnectivity" is sent Then the response status 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 includes property "$.operationId" - And the request with the response body will be received at the address of the request property "$.sink" + And the request with the response body will be received at the address of the request property "$.sink" with property "$.operationId" equal to response property "$.operationId" And the request will have header "Authorization" set to "Bearer " + the value of the request property "$.sinkCredential.accessToken" - And the request will have property "$.operationId" equal to response property "$.operationId" And the request body complies with the OAS schema at "/components/schemas/ConnectivityDataAsyncResponse" @predictive_connectivity_data_05_async_operation_not_completed_scenario Scenario: Validate async callback when operation fails # Property "$.sink" is set with a valid public accessible HTTPs endpoint Given the request body property "$.area" is set to a valid testing area within supported regions - And the request body property "$.startTime" is set to a valid testing future date-time - And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" + And the request body properties "$.startTime" and "$.endTime" are valid future date-times, with "$.endTime" later than "$.startTime" And the request body property "$.serviceLevel" is set to a valid communication service level And the request body property "$.sink" is set to a valid HTTPS URL - And the request property "$.sinkCredential.credentialType" is set to "ACCESSTOKEN" - And the request property "$.sinkCredential.accessTokenType" is set to "bearer" - And the request property "$.sinkCredential.accessToken" is set to a valid access token accepted by the events receiver - And the request property "$.sinkCredential.accessTokenExpiresUtc" is set to a value long enough in the future + And the request body property "$.sinkCredential" is set to a valid credential with property "$.sinkCredential.credentialType" set to "ACCESSTOKEN" When the request "retrieveConnectivity" is sent Then the response status 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 includes property "$.operationId" And there have been some problem processing the request asynchronously - And the request with the response body will be received at the address of the request property "$.sink" + And the request with the response body will be received at the address of the request property "$.sink" with property "$.operationId" equal to response property "$.operationId" And the request will have header "Authorization" set to "Bearer " + the value of the request property "$.sinkCredential.accessToken" - And the request will have property "$.operationId" equal to response property "$.operationId" And the request body complies with the OAS schema at "/components/schemas/ConnectivityDataAsyncResponse" - And the request body will have property "$.status" equal to "OPERATION_NOT_COMPLETED" - And the callback request body will include property "$.statusInfo" + And the request body will have property "$.status" equal to "OPERATION_NOT_COMPLETED" and includes property "$.statusInfo" @predictive_connectivity_data_06_custom_precision_success_scenario Scenario: Validate success response for a request specifying the precision of the geohashes Given the request body property "$.area" is set to a valid testing area within supported regions - And the request body property "$.startTime" is set to a valid testing future date-time - And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" + And the request body properties "$.startTime" and "$.endTime" are valid future date-times, with "$.endTime" later than "$.startTime" And the request body property "$.serviceLevel" is set to a valid communication service level And the request body property "$.precision" is set to a valid precision for the geohash response cells When the request "retrieveConnectivity" is sent @@ -143,8 +128,7 @@ Feature: CAMARA Predictive Connectivity Data API, v0.1 @predictive_connectivity_data_07_concrete_network_type_success_scenario Scenario: Validate success response for a request specifying the network type for which the connectivity data is to be obtained Given the request body property "$.area" is set to a valid testing area within supported regions - And the request body property "$.startTime" is set to a valid testing future date-time - And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" + And the request body properties "$.startTime" and "$.endTime" are valid future date-times, with "$.endTime" later than "$.startTime" And the request body property "$.serviceLevel" is set to a valid communication service level And the request body property "$.networkType" is set to a valid networkType When the request "retrieveConnectivity" is sent @@ -156,8 +140,7 @@ Feature: CAMARA Predictive Connectivity Data API, v0.1 @predictive_connectivity_data_08_concrete_height_success_scenario Scenario: Validate success response for a request specifying the height for which the connectivity data is to be obtained Given the request body property "$.area" is set to a valid testing area within supported regions - And the request body property "$.startTime" is set to a valid testing future date-time - And the request body property "$.endTime" is set to a valid testing future date-time later than body property "$.startTime" + And the request body properties "$.startTime" and "$.endTime" are valid future date-times, with "$.endTime" later than "$.startTime" And the request body property "$.serviceLevel" is set to a valid communication service level And the request body property "$.height" is set to a valid height in metres above ground level When the request "retrieveConnectivity" is sent @@ -172,8 +155,7 @@ Feature: CAMARA Predictive Connectivity Data API, v0.1 @predictive_connectivity_data_09_include_signal_strength Scenario: Validate success response for a request including signal strength Given the request body property "$.area" is set to a valid testing area within supported regions - And the request body property "$.startTime" is set to a valid testing date-time - And the request body property "$.endTime" is set to a valid testing date-time later than body property "$.startTime" + And the request body properties "$.startTime" and "$.endTime" are valid future date-times, with "$.endTime" later than "$.startTime" And the request body property "$.serviceLevel" is set to a valid communication service level And the request body property "$.includeSignalStrength" is set to true When the request "retrieveConnectivity" is sent @@ -182,17 +164,13 @@ Feature: CAMARA Predictive Connectivity Data API, v0.1 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/ConnectivityDataResponse" And the response property "$.status" value is "SUPPORTED_AREA" - And the response property "$.timedConnectivityData[*].startTime" is equal to or later than request body property "$.startTime" - And the response property "$.timedConnectivityData[*].endTime" is equal to or earlier than request body property "$.endTime" - And the response property "$.timedConnectivityData[*].cellConnectivityData[*].geohash" is a valid Geohash inside the request area And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities[*]" is not empty - And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerSignalStrengths[*]" has the same length as "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities[*]" + And the response property "$.timedConnectivityData[*].cellConnectivityData[*]" have properties "layerConnectivities[*]" and "layerSignalStrengths[*]" having the same length @predictive_connectivity_data_10_supported_area_past_success_scenario Scenario: Validate success response for a supported area in a past time period request Given the request body property "$.area" is set to a valid testing area within supported regions - And the request body property "$.startTime" is set to a valid testing date-time in the past - And the request body property "$.endTime" is set to a valid testing past date-time later than body property "$.startTime" + And the request body properties "$.startTime" and "$.endTime" are valid past date-times, with "$.endTime" later than "$.startTime" And the request body property "$.serviceLevel" is set to a valid communication service level When the request "retrieveConnectivity" is sent Then the response status code is 200 @@ -453,8 +431,9 @@ Feature: CAMARA Predictive Connectivity Data API, v0.1 And the response property "$.message" contains a user friendly text @predictive_connectivity_data_422.02_too_big_synchronous_response + #To test this scenario provided values for "$.area.boundary", "$.startTime", "$.endTime" and "$.precision" MUST generate a response too big for a synchronous response Scenario: Error 422 when the response is too big for a sync response - Given the request body properties "$.area.boundary", "$.startTime", "$.endTime" and "$.precision" are set to valid values but generate a response too big for a synchronous response + Given the request body properties "$.area.boundary", "$.startTime", "$.endTime" and "$.precision" are set to valid values When the request "retrieveConnectivity" is sent Then the response status code is 422 And the response header "Content-Type" is "application/json" @@ -463,9 +442,9 @@ Feature: CAMARA Predictive Connectivity Data API, v0.1 And the response property "$.message" contains a user friendly text @predictive_connectivity_data_422.03_too_big_request + #To test this scenario provided values for "$.area.boundary", "$.startTime", "$.endTime" and "$.precision" MUST generate a too big response in both sync and async scenarios Scenario: Error 422 when the response is too big for a sync and async response - Given the request body properties "$.area.boundary", "$.startTime", "$.endTime" and "$.precision" are set to valid values but generate a response too big for a synchronous and asynchronous response - When the request "retrieveConnectivity" is sent + Given the request body properties "$.area.boundary", "$.startTime", "$.endTime" and "$.precision" are set to valid values Then the response status code is 422 And the response header "Content-Type" is "application/json" And the response property "$.status" is 422 From 9afde5dc7d91168b83e700f643da5f70652e2f0a Mon Sep 17 00:00:00 2001 From: Alberto Ramos Monagas Date: Thu, 28 Aug 2025 13:36:57 +0200 Subject: [PATCH 7/7] fix: remove trailing spaces --- code/Test_definitions/predictive-connectivity-data.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Test_definitions/predictive-connectivity-data.feature b/code/Test_definitions/predictive-connectivity-data.feature index 65bd3ba..6c5030d 100644 --- a/code/Test_definitions/predictive-connectivity-data.feature +++ b/code/Test_definitions/predictive-connectivity-data.feature @@ -59,7 +59,7 @@ Feature: CAMARA Predictive Connectivity Data API, v0.1 And the response property "$.status" value is "PART_OF_AREA_NOT_SUPPORTED" And the response property "$.timedConnectivityData[*].startTime" is equal to or later than request body property "$.startTime" And the response property "$.timedConnectivityData[*].endTime" is equal to or earlier than request body property "$.endTime" - And there is at least one item in response property "$.timedConnectivityData[*].cellConnectivityData[*]" + And there is at least one item in response property "$.timedConnectivityData[*].cellConnectivityData[*]" And that item has an array property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities[*]" containing only "ND" values And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerConnectivities" is not empty And the response property "$.timedConnectivityData[*].cellConnectivityData[*].layerSignalStrengths" is not included in the response