Skip to content
Merged
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
6 changes: 3 additions & 3 deletions code/API_definitions/iot-network-optimization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,9 @@ components:
type: string
pattern: ^[a-zA-Z0-9-_:;.\/<>{}]{0,256}$
example: "b4333c46-49c0-4f62-80d7-f0ef930f1c46"
############################################################################
# Responses #
############################################################################
############################################################################
# Responses #
############################################################################
ErrorInfo:
description: error information
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,19 @@ Feature: CAMARA IoT Network Optimization API - vwip - Operation power-saving
@power_saving_feature_01_generic_success_scenario_one_device
Scenario: Common validations for any success scenario, just one device identifier is provided
# Valid testing default request body compliant with the schema
Given the request body property "$.devices" carries one valid device which is compliant with the OAS schema at "/components/schemas/Device"
Given the request body property "$.devices" carries one valid device compliant with the OAS schema at "/components/schemas/Device"
And "$.enabled" is set to true
And "$.notificationSink" is set to a proper value
When the HTTP "POST" request is sent
Then the power saving settings will be activated for all the devices specified
And 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 status code is 200
And the response header "Content-Type" is "application/json" and "x-correlator" has same value as the request header "x-correlator"
# The response has to comply with the generic response schema which is part of the spec
And the response body complies with the OAS schema at "/components/schemas/PowerSavingResponse"
And "$.transactionId" is set to a proper value
# The received callback must be compliant and should carry the aspected values
And within a limited period of time I should receive a callback at "/components/schemas/NotificationSink/sink"
And the callback body is compliant with the OAS schema at "/components/callbacks/onTransactionCompleted" with "x-correlator" having the same value as the request header "x-correlator"
And I receive a callback at "/components/schemas/NotificationSink/sink" with the body compliant to "/components/callbacks/onTransactionCompleted"
And "x-correlator" as the same value as the request header "x-correlator"
And the callback carries the information defined in "/components/schemas/CloudEventPowerSaving"
And "/components/schemas/CloudEventPowerSaving" in the callback should contain the parameter "$.transactionId" with the same value as in the 200 response of "/features/power-saving"
And "/components/schemas/CloudEventPowerSaving" in the callback should contain the parameter "$.activationStatus" set to the expected value
Expand All @@ -46,15 +45,13 @@ Feature: CAMARA IoT Network Optimization API - vwip - Operation power-saving
And "$.notificationSink" is set to a proper value
When the HTTP "POST" request is sent
Then the power saving settings will be activated for all the devices specified
And 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 status code is 200
And the response header "Content-Type" is "application/json" and "x-correlator" has same value as the request header "x-correlator"
# The response has to comply with the generic response schema which is part of the spec
And the response body complies with the OAS schema at "/components/schemas/PowerSavingResponse"
And "$.transactionId" is set to a proper value
And the response body complies with the OAS schema at "/components/schemas/PowerSavingResponse" and "$.transactionId" is set to a proper value
# The received callback must be compliant and should carry the aspected values
And within a limited period of time I should receive a callback at "/components/schemas/NotificationSink/sink"
And the callback body is compliant with the OAS schema at "/components/callbacks/onTransactionCompleted" with "x-correlator" having the same value as the request header "x-correlator"
And I should receive a callback at "/components/schemas/NotificationSink/sink" with the body compliant with "/components/callbacks/onTransactionCompleted"
And "x-correlator" as the same value as the request header "x-correlator"
And the callback carries the information defined in "/components/schemas/CloudEventPowerSaving"
And "/components/schemas/CloudEventPowerSaving" in the callback should contain the parameter "$.transactionId" with the same value as in the 200 response of "/features/power-saving"
And "/components/schemas/CloudEventPowerSaving" in the callback should contain the parameter"$.activationStatus"
Expand All @@ -65,21 +62,17 @@ Feature: CAMARA IoT Network Optimization API - vwip - Operation power-saving
@power_saving_feature_03_optional_parameters
Scenario: multiple devices identifiers are provided with also optional parameters
Given the request body property "$.devices" carries an array of valid devices which are compliant with the OAS schema at "/components/schemas/Device"
And "$.enabled" is set to true
And "$.notificationSink" is set to a proper value
And "$.timePeriod" is set to a proper value
And "$.enabled" is set to true and "$.notificationSink" is set to a proper value and "$.timePeriod" is set to a proper value
When the HTTP "POST" request is sent
Then the power saving settings will be activated for all the devices specified
And the activation will follow the parameters specified (e.g., only during the selected time period)
And 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 header "Content-Type" is "application/json" and "x-correlator" has same value as the request header "x-correlator"
# The response has to comply with the generic response schema which is part of the spec
And the response body complies with the OAS schema at "/components/schemas/PowerSavingResponse"
And "$.transactionId" is set to a proper value
And the response body complies with the OAS schema at "/components/schemas/PowerSavingResponse" with "$.transactionId" is set to a proper value
# The received callback must be compliant and should carry the aspected values
And within a limited period of time I should receive a callback at "/components/schemas/NotificationSink/sink"
And the callback body is compliant with the OAS schema at "/components/callbacks/onTransactionCompleted" with "x-correlator" having the same value as the request header "x-correlator"
And I should receive a callback at "/components/schemas/NotificationSink/sink" with the body compliant with "/components/callbacks/onTransactionCompleted"
And "x-correlator" as the same value as the request header "x-correlator"
And the callback carries the information defined in "/components/schemas/CloudEventPowerSaving"
And "/components/schemas/CloudEventPowerSaving" in the callback should contain the parameter "$.transactionId" with the same value as in the 200 response of "/features/power-saving"
And "/components/schemas/CloudEventPowerSaving" in the callback should contain the parameter"$.activationStatus"
Expand Down Expand Up @@ -109,7 +102,6 @@ Feature: CAMARA IoT Network Optimization API - vwip - Operation power-saving
And the error code is "INVALID_ARGUMENT"
And the response header "Content-Type" is "application/json"


# This scenario show how request with no authentication token will be handled
@power_saving_feature_06_no_auth
Scenario: Fail to enable power-saving when no authentication token is provided
Expand Down