Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 43 additions & 10 deletions code/Test_definitions/dedicated-network-accesses.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Feature: CAMARA Dedicated Network API, vwip - Network Accesses API Operations
Then the response status code is 200
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has the same value as the request header "x-correlator"
And the response body is an array where each item complies with the OAS schema at "/components/schemas/NetworkAccessInfo"
And the response body is an array where each item complies with the OAS schema at "/components/schemas/AccessInfo"

@dedicated_network_accesses_listNetworkAccesses_02_success_filtered_by_network
Scenario: List network accesses filtered by network ID
Expand All @@ -36,7 +36,7 @@ Feature: CAMARA Dedicated Network API, vwip - Network Accesses API Operations
Then the response status code is 200
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has the same value as the request header "x-correlator"
And the response body is an array where each item complies with the OAS schema at "/components/schemas/NetworkAccessInfo"
And the response body is an array where each item complies with the OAS schema at "/components/schemas/AccessInfo"
And each item in the response array has property "networkId" equal to the query parameter "networkId"

@dedicated_network_accesses_listNetworkAccesses_03_success_filtered_by_device
Expand All @@ -48,7 +48,8 @@ Feature: CAMARA Dedicated Network API, vwip - Network Accesses API Operations
Then the response status code is 200
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has the same value as the request header "x-correlator"
And the response body is an array where each item complies with the OAS schema at "/components/schemas/NetworkAccessInfo"
And the response body is an array where each item complies with the OAS schema at "/components/schemas/AccessInfo"
#And the response property "$.device" contains the same device identifier information as provided in the "x-device" header
And each item in the response array has property "device" containing the device identifier information that corresponds to the device specified in the "x-device" header

# Success scenarios for POST /accesses
Expand All @@ -58,40 +59,72 @@ Feature: CAMARA Dedicated Network API, vwip - Network Accesses API Operations
Given an existing dedicated network
And the resource "/dedicated-network-accesses/vwip/accesses"
And the header "Content-Type" is set to "application/json"
And the header "x-device" is set to a RFC 8941 structured field value representing the Device schema (#/components/schemas/Device) (e.g., 'phonenumber="+123456789"')
And the request body is set to a request body compliant with the schema at "/components/schemas/CreateNetworkAccess"
And the request body property "$.networkId" is set to the ID of the existing network
And the request body property "$.devices" array contains one or more (up to 100) valid device objects
When the request "createNetworkAccess" is sent
Then the response status code is 201
And the response header "Content-Type" is "application/json"
And the response header "x-correlator" has the same value as the request header "x-correlator"
And the response header "Location" exists and contains a URL with the created access ID
And the response body complies with the OAS schema at "/components/schemas/NetworkAccessInfo"
And the response body complies with the OAS schema at "/components/schemas/AccessInfo"
And the response property "$.networkId" has the same value as in the request body
And the response property "$.device" contains the same device identifier information as provided in the "x-device" header
And the response property "$.id" exists and is a valid UUID
And the response property "$.stats" exists and complies with the OAS schema at "/components/schemas/AccessStats"

# Success scenarios for GET /accesses/{accessId}

@dedicated_network_accesses_readNetworkAccess_01_success
Scenario: Get details of a specific network access
Given an existing network access
Given an existing dedicated network
And an existing network access
And the resource "/dedicated-network-accesses/vwip/accesses/{accessId}"
And the path parameter "accessId" is set to the ID of the existing access
When the request "readNetworkAccess" 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 the same value as the request header "x-correlator"
And the response body complies with the OAS schema at "/components/schemas/NetworkAccessInfo"
And the response body complies with the OAS schema at "/components/schemas/AccessInfo"
And the response property "$.id" is equal to the path parameter "accessId"
And the response property "$.stats" complies with the OAS schema at "/components/schemas/AccessStats"

# Success scenarios for DELETE /accesses/{accessId}

@dedicated_network_accesses_deleteNetworkAccess_01_success
Scenario: Delete a network access
Given an existing network access
Given an existing dedicated network
And an existing network access
And the resource "/dedicated-network-accesses/vwip/accesses/{accessId}"
And the path parameter "accessId" is set to the ID of the existing access
When the request "deleteNetworkAccess" is sent
Then the response status code is 204
And the response header "x-correlator" has the same value as the request header "x-correlator"
And the response header "x-correlator" has the same value as the request header "x-correlator"

# Success scenarios for POST /devices/add

@dedicated_network_accesses_addNetworkaccess_01_success
Scenario: Add a device to an existing network access
Given an existing dedicated network
And an existing network access
And the resource "/dedicated-network-accesses/vwip/accesses/{accessId}/devices/add"
And the path parameter "accessId" is set to the ID of the existing access
And the header "Content-Type" is set to "application/json"
And the request body is set to a request body compliant with the schema at "/components/schemas/AddDevicesRequest"
And the request body array contains one or more (up to 100) valid device objects
When the request "addDevicesRequest" is sent
Then the response status code is 201
And the response body complies with the OAS schema at "/components/schemas/AddDevicessSuccess"

# Success scenarios for POST /devices/remove

@dedicated_network_accesses_removeNetworkaccess_01_success
Scenario: Remove a device to an existing network access
Given an existing dedicated network
And an existing network access
And the resource "/dedicated-network-accesses/vwip/accesses/{accessId}/devices/add"
And the path parameter "accessId" is set to the ID of the existing access
And the header "Content-Type" is set to "application/json"
And the request body is set to a request body compliant with the schema at "/components/schemas/RemoveDevicesRequest"
And the request body array contains one or more (up to 100) valid device objects
When the request "removeDevicesRequest" is sent
Then the response status code is 204
133 changes: 133 additions & 0 deletions code/Test_definitions/dedicated-network-areas.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
Feature: CAMARA Dedicated Network API, vwip - Areas API Operations
# Input to be provided by the implementation to the tester
#
# Implementation indications:
# * apiRoot: API root of the server URL
#
# Testing assets:
# * At least one existing area
#
# References to OAS spec schemas refer to schemas specified in dedicated-network-areas.yaml

Background: Common areas setup
Given an environment at "apiRoot"
And the header "Authorization" is set to a valid access token
And the header "x-correlator" complies with the schema at "#/components/schemas/XCorrelator"

# Success scenarios for POST /retrieve-service-areas

@dedicated_network_areas_retrieveServiceAreas_01_success
Scenario: Retrieve all service areas (basic success)
Given the resource "/dedicated-network-areas/vwip/retrieve-service-areas"
And the header "Content-Type" is set to "application/json"
And the request body is set to a request body compliant with the schema at "/components/schemas/RetrieveServiceAreasRequest"
When the request "retrieveServiceAreas" is sent
Then the response status code is 200
And the response header "Content-Type" is "application/json"
And the response body is an array where each item complies with the OAS schema at "/components/schemas/ServiceArea"

@dedicated_network_areas_retrieveServiceAreas_02_success_filtered_by_atLocation
Scenario: List areas filtered by atLocation
Given the resource "/dedicated-network-areas/vwip/retrieve-service-areas"
And the header "Content-Type" is set to "application/json"
And the request body is set to a request body compliant with the schema at "/components/schemas/RetrieveServiceAreasRequest"
And the request body property "$.atLocation" is set to valid coordinates
When the request "retrieveServiceAreas" is sent
Then the response status code is 200
And the response header "Content-Type" is "application/json"
And the response body is an array where each item complies with the OAS schema at "/components/schemas/ServiceArea"

@dedicated_network_areas_retrieveServiceAreas_03_success_filtered_by_overlappingArea
Scenario: List areas filtered by overlappingArea
Given the resource "/dedicated-network-areas/vwip/retrieve-service-areas"
And the header "Content-Type" is set to "application/json"
And the request body is set to a request body compliant with the schema at "/components/schemas/RetrieveServiceAreasRequest"
And the request body property "$.overlappingArea" is set to a valid area
When the request "retrieveServiceAreas" is sent
Then the response status code is 200
And the response header "Content-Type" is "application/json"
And the response body is an array where each item complies with the OAS schema at "/components/schemas/ServiceArea"

@dedicated_network_areas_retrieveServiceAreas_04_success_filtered_by_coveringArea
Scenario: List areas filtered by coveringArea
Given the resource "/dedicated-network-areas/vwip/retrieve-service-areas"
And the header "Content-Type" is set to "application/json"
And the request body is set to a request body compliant with the schema at "/components/schemas/RetrieveServiceAreasRequest"
And the request body property "$.coveringArea" is set to a valid area
When the request "retrieveServiceAreas" is sent
Then the response status code is 200
And the response header "Content-Type" is "application/json"
And the response body is an array where each item complies with the OAS schema at "/components/schemas/ServiceArea"

@dedicated_network_areas_retrieveServiceAreas_05_success_filtered_by_byName
Scenario: List areas filtered by byName
Given the resource "/dedicated-network-areas/vwip/retrieve-service-areas"
And the header "Content-Type" is set to "application/json"
And the request body is set to a request body compliant with the schema at "/components/schemas/RetrieveServiceAreasRequest"
And the request body property "$.byName" is set to a valid area name
When the request "retrieveServiceAreas" is sent
Then the response status code is 200
And the response header "Content-Type" is "application/json"
And the response body is an array where each item complies with the OAS schema at "/components/schemas/ServiceArea"

@dedicated_network_areas_retrieveServiceAreas_06_success_filtered_by_byNetworkProfileId
Scenario: List areas filtered by byNetworkProfileId
Given the resource "/dedicated-network-areas/vwip/retrieve-service-areas"
And the header "Content-Type" is set to "application/json"
And the request body is set to a request body compliant with the schema at "/components/schemas/RetrieveServiceAreasRequest"
And the request body property "$.byNetworkProfileId" is set to a valid network profile
When the request "retrieveServiceAreas" is sent
Then the response status code is 200
And the response header "Content-Type" is "application/json"
And the response body is an array where each item complies with the OAS schema at "/components/schemas/ServiceArea"

@dedicated_network_areas_retrieveServiceAreas_06_success_filtered_by_byQosProfileName
Scenario: List areas filtered by byQosProfileName
Given the resource "/dedicated-network-areas/vwip/retrieve-service-areas"
And the header "Content-Type" is set to "application/json"
And the request body is set to a request body compliant with the schema at "/components/schemas/RetrieveServiceAreasRequest"
And the request body property "$.byQosProfileName" is set to a valid qos profile
When the request "retrieveServiceAreas" is sent
Then the response status code is 200
And the response header "Content-Type" is "application/json"
And the response body is an array where each item complies with the OAS schema at "/components/schemas/ServiceArea"


# Success scenarios for GET /areas/{areaId}

@dedicated_network_areas_readServiceAreas_01_success
Scenario: Get details of a specific service area
Given the resource "/dedicated-network-areas/vwip/areas/{areaId}"
And the path parameter "areaId" is set to a valid service area ID
When the request "readServiceArea" is sent
Then the response status code is 200
And the response header "Content-Type" is "application/json"
And the response body complies with the OAS schema at "/components/schemas/ServiceArea"
And the response property "$.id" exists and is a valid UUID

# Error scenarios

@areas_retrieveServiceAreas_04_error_invalid_coordinates
Scenario: Retrieve service areas with invalid coordinates
Given the resource "/dedicated-network-areas/v0.1-eri/retrieve-service-areas"
And the header "Content-Type" is set to "application/json"
And the request body is set to a request body compliant with the schema at "/components/schemas/RetrieveServiceAreasRequest"
And the request body property "$.atLocation.latitude" is set to "999"
And the request body property "$.atLocation.longitude" is set to "7.10066"
When the request "retrieveServiceAreas" is sent
Then the response status code is 400

@areas_readServiceArea_02_error_invalid_uuid
Scenario: Read service area with invalid UUID
Given the resource "/dedicated-network-areas/v0.1-eri/areas/{areaId}"
And the path parameter "areaId" is set to an invalid UUID
When the request "readServiceArea" is sent
# Then the response status code is 400
Then the response status code is 404

@areas_readServiceArea_03_error_not_found
Scenario: Read non-existent service area
Given the resource "/dedicated-network-areas/v0.1-eri/areas/{areaId}"
And the path parameter "areaId" is set to a non-existent UUID
When the request "readServiceArea" is sent
Then the response status code is 404
16 changes: 7 additions & 9 deletions code/Test_definitions/dedicated-network.feature
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ Feature: CAMARA Dedicated Network API, vwip - Networks API Operations
Given the resource "/dedicated-network/vwip/networks"
And the header "Content-Type" is set to "application/json"
And the request body is set to a request body compliant with the schema at "/components/schemas/CreateNetwork"
And the request body property "$.profileId" is set to a valid network profile ID
And the request body property "$.networkProfileId" is set to a valid network profile ID
And the request body property "$.serviceTime" is set to a valid service time window
And the request body property "$.serviceArea.areaType" is set to "AREANAME"
And the request body property "$.serviceArea.areaName" is set to a valid area name
And the request body property "$.serviceAreaId" is set to a valid area name
When the request "createNetwork" is sent
Then the response status code is 201
And the response header "Content-Type" is "application/json"
Expand All @@ -52,17 +51,16 @@ Feature: CAMARA Dedicated Network API, vwip - Networks API Operations
Given the resource "/dedicated-network/vwip/networks"
And the header "Content-Type" is set to "application/json"
And the request body is set to a request body compliant with the schema at "/components/schemas/CreateNetwork"
And the request body property "$.profileId" is set to a valid network profile ID
And the request body property "$.networkProfileId" is set to a valid network profile ID
And the request body property "$.serviceTime" is set to a valid service time window
And the request body property "$.serviceArea.areaType" is set to "AREANAME"
And the request body property "$.serviceArea.areaName" is set to a valid area name
And the request body property "$.serviceAreaId" is set to a valid area name
And the request body property "$.sink" is set to a valid notification URL
And the request body property "$.sinkCredential.credentialType" is set to "ACCESSTOKEN"
When the request "createNetwork" is sent
Then the response status code is 201
And the response property "$.profileId" has the same value as in the request body
And the response property "$.networkProfileId" has the same value as in the request body
And the response property "$.serviceTime" has the same value as in the request body
And the response property "$.serviceArea" has the same value as in the request body
And the response property "$.serviceAreaId" has the same value as in the request body
And the response property "$.sink" exists only if provided in the request body and with the same value

# Success scenarios for GET /networks/{networkId}
Expand All @@ -88,4 +86,4 @@ Feature: CAMARA Dedicated Network API, vwip - Networks API Operations
And the path parameter "networkId" is set to the ID of the existing network
When the request "deleteNetwork" is sent
Then the response status code is 204
And the response header "x-correlator" has the same value as the request header "x-correlator"
And the response header "x-correlator" has the same value as the request header "x-correlator"
Loading