From d0d5d08af7baefde18bab51d23757f8ff1b5c209 Mon Sep 17 00:00:00 2001 From: FabrizioMoggio <87469955+FabrizioMoggio@users.noreply.github.com> Date: Wed, 29 Oct 2025 11:49:08 +0100 Subject: [PATCH 1/4] Mega Linter Fix related to: https://github.com/camaraproject/IoTNetworkOptimization/pull/31 --- code/API_definitions/iot-network-optimization.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/API_definitions/iot-network-optimization.yaml b/code/API_definitions/iot-network-optimization.yaml index aab2242..7a1d39c 100644 --- a/code/API_definitions/iot-network-optimization.yaml +++ b/code/API_definitions/iot-network-optimization.yaml @@ -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 @@ -798,4 +798,4 @@ components: value: status: 501 code: NOT_IMPLEMENTED - message: This functionality is not implemented yet. + message: This functionality is not implemented yet. \ No newline at end of file From b4a43cab2b5e71c88ed4e30eff53758ea9f0a003 Mon Sep 17 00:00:00 2001 From: FabrizioMoggio <87469955+FabrizioMoggio@users.noreply.github.com> Date: Wed, 29 Oct 2025 11:52:55 +0100 Subject: [PATCH 2/4] ML Fix --- code/API_definitions/iot-network-optimization.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/API_definitions/iot-network-optimization.yaml b/code/API_definitions/iot-network-optimization.yaml index 7a1d39c..1e8f64e 100644 --- a/code/API_definitions/iot-network-optimization.yaml +++ b/code/API_definitions/iot-network-optimization.yaml @@ -798,4 +798,4 @@ components: value: status: 501 code: NOT_IMPLEMENTED - message: This functionality is not implemented yet. \ No newline at end of file + message: This functionality is not implemented yet. From 6a122c0b75a84a56a4f5b14d0f19b98a9983bfe4 Mon Sep 17 00:00:00 2001 From: FabrizioMoggio <87469955+FabrizioMoggio@users.noreply.github.com> Date: Wed, 29 Oct 2025 12:24:03 +0100 Subject: [PATCH 3/4] ML Fix --- ...-network-optimization-power-saving.feature | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/code/Test_definitions/iot-network-optimization-power-saving.feature b/code/Test_definitions/iot-network-optimization-power-saving.feature index 8332928..3722a5c 100644 --- a/code/Test_definitions/iot-network-optimization-power-saving.feature +++ b/code/Test_definitions/iot-network-optimization-power-saving.feature @@ -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 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" # 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 should receive a callback at "/components/schemas/NotificationSink/sink" with the body compliant with "/components/callbacks/onTransactionCompleted" with "x-correlator" with 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 @@ -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 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" # 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" with "x-correlator" with 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" @@ -65,9 +62,7 @@ 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) @@ -75,11 +70,9 @@ Feature: CAMARA IoT Network Optimization API - vwip - Operation power-saving And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" # The response has to comply with the generic response schema which is part of the spec - And the response body complies with the OAS schema at "/components/schemas/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" with "x-correlator" with 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" @@ -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 From 2294dbd7235244079649ea7b9906b4623d0b0111 Mon Sep 17 00:00:00 2001 From: FabrizioMoggio <87469955+FabrizioMoggio@users.noreply.github.com> Date: Wed, 29 Oct 2025 12:34:31 +0100 Subject: [PATCH 4/4] ML Fix --- ...t-network-optimization-power-saving.feature | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/code/Test_definitions/iot-network-optimization-power-saving.feature b/code/Test_definitions/iot-network-optimization-power-saving.feature index 3722a5c..edb27c7 100644 --- a/code/Test_definitions/iot-network-optimization-power-saving.feature +++ b/code/Test_definitions/iot-network-optimization-power-saving.feature @@ -25,13 +25,13 @@ Feature: CAMARA IoT Network Optimization API - vwip - Operation power-saving 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 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 I should receive a callback at "/components/schemas/NotificationSink/sink" with the body compliant with "/components/callbacks/onTransactionCompleted" with "x-correlator" with 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 @@ -46,12 +46,12 @@ Feature: CAMARA IoT Network Optimization API - vwip - Operation power-saving 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 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 I should receive a callback at "/components/schemas/NotificationSink/sink" with the body compliant with "/components/callbacks/onTransactionCompleted" with "x-correlator" with 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" @@ -67,12 +67,12 @@ Feature: CAMARA IoT Network Optimization API - vwip - Operation power-saving 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" with "$.transactionId" is set to a proper value # The received callback must be compliant and should carry the aspected values - And I should receive a callback at "/components/schemas/NotificationSink/sink" with the body compliant with "/components/callbacks/onTransactionCompleted" with "x-correlator" with 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"