From 4b5f348caa91391def0cd13282467503a31a566e Mon Sep 17 00:00:00 2001 From: Maximilian Laue Date: Wed, 30 Oct 2024 13:58:19 +0100 Subject: [PATCH] feat: update device-reachability-status.feature --- .../device-reachability-status.feature | 76 ++++++++++--------- 1 file changed, 42 insertions(+), 34 deletions(-) diff --git a/code/Test_definitions/device-reachability-status.feature b/code/Test_definitions/device-reachability-status.feature index 094ac36..bf18bc9 100644 --- a/code/Test_definitions/device-reachability-status.feature +++ b/code/Test_definitions/device-reachability-status.feature @@ -13,49 +13,57 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi ############# Happy Path Scenarios ################## - @device_reachability_status_01_reachabilityStatusConnectedSms + @device_reachability_status_01_reachableAndConnectedSms Scenario: Check the reachability status if device is connected with SMS - Given a valid devicestatus request body + Given a valid device reachability status request body And the request body property "$.device" is set to a valid testing device which is connected with sms and supported by the service When the request "getReachabilityStatus" is sent Then the response code is 200 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" And the response body complies with the OAS schema at "/components/schemas/ReachabilityStatusResponse" - And the response property "$.status" is 200 - And the response property "$.code" is "OK" - And the response property "$.message" contains a user friendly text - And the response property "$.reachabilityStatus" is "CONNECTED_SMS" + And the response property "$.reachable" is true + And the response property "$.connectivity" is ["SMS"] - @device_reachability_status_02_reachabilityStatusConnectedData + @device_reachability_status_02_reachableAndConnectedData Scenario: Check the reachability status if device is connected with DATA - Given a valid devicestatus request body + Given a valid device reachability status request body + And the request body property "$.device" is set to a valid testing device which is connected with data and supported by the service + When the request "getReachabilityStatus" is sent + Then the response code is 200 + And the response header "Content-Type" is "application/json" + And the response header "x-correlator" has same value as the request header "x-correlator" + And the response body complies with the OAS schema at "/components/schemas/ReachabilityStatusResponse" + And the response property "$.reachable" is true + And the response property "$.connectivity" is ["DATA"] + + @device_reachability_status_03_reachableAndConnectedDataAndSms + Scenario: Check the reachability status if device is connected with DATA + Given a valid device reachability status request body And the request body property "$.device" is set to a valid testing device which is connected with data and supported by the service When the request "getReachabilityStatus" is sent Then the response code is 200 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" And the response body complies with the OAS schema at "/components/schemas/ReachabilityStatusResponse" - And the response property "$.status" is 200 - And the response property "$.code" is "OK" - And the response property "$.reachabilityStatus" is "CONNECTED_DATA" + And the response property "$.reachable" is true + And the response property "$.connectivity" is ["DATA","SMS"] - @device_reachability_status_03_reachabilityStatusDeviceNotConnected - Scenario: Check the reachability status for DeviceNotConnected - Given a valid devicestatus request body + @device_reachability_status_04_notReachable + Scenario: Check the reachability status for an unreachable device + Given a valid device reachability status request body And the request body property "$.device" is set to a valid testing device which is not connected and supported by the service When the request "getReachabilityStatus" is sent Then the response code is 200 And the response header "Content-Type" is "application/json" And the response header "x-correlator" has same value as the request header "x-correlator" And the response body complies with the OAS schema at "/components/schemas/ReachabilityStatusResponse" - And the response property "$.status" is 200 - And the response property "$.code" is "OK" - And the response property "$.reachabilityStatus" is "NOT_CONNECTED" + And the response property "$.reachable" is false + And the response property "$.connectivity" is not returned #############Error Response Scenarios################## - @device_reachability_status_04_deviceStatus_with_invalid_parameter + @device_reachability_status_05_deviceStatus_with_invalid_parameter Scenario: Device reachability status request with invalid parameter Given the request body is not compliant with the schema "/components/schemas/RequestReachabilityStatus" When the request "getReachabilityStatus" is sent @@ -64,9 +72,9 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response property "$.code" is "INVALID_ARGUMENT" And the response property "$.message" contains a user friendly text - @device_reachability_status_05_expired_access_token + @device_reachability_status_06_expired_access_token Scenario: Expired access token - Given a valid devicestatus request body + Given a valid device reachability status request body And header "Authorization" is set to expired token When the request "getReachabilityStatus" is sent Then the response status code is 401 @@ -74,9 +82,9 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - @device_reachability_status_06_no_authorization_header + @device_reachability_status_07_no_authorization_header Scenario: No Authorization header - Given a valid devicestatus request body + Given a valid device reachability status request body And header "Authorization" is not available When the request "getReachabilityStatus" is sent Then the response status code is 401 @@ -84,9 +92,9 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - @device_reachability_status_07_invalid_access_token + @device_reachability_status_08_invalid_access_token Scenario: Invalid access token - Given a valid devicestatus request body + Given a valid device reachability status request body And header "Authorization" set to an invalid access token When the request "getReachabilityStatus" is sent Then the response status code is 401 @@ -95,10 +103,10 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response property "$.code" is "UNAUTHENTICATED" And the response property "$.message" contains a user friendly text - @device_reachability_status_08_deviceStatus_inconsistent_access_token + @device_reachability_status_09_deviceStatus_inconsistent_access_token Scenario: Inconsistent access token context for the device # To test this, a token has to be obtained for a different device - Given a valid devicestatus request body + Given a valid device reachability status request body And the request body property "$.device" is set to a valid testing device supported by the service And header "Authorization" set to access token referring different device When the request "getReachabilityStatus" is sent @@ -107,10 +115,10 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response property "$.code" is "INVALID_TOKEN_CONTEXT" And the response property "$.message" contains a user friendly text - @device_reachability_status_09_deviceStatusWithIdentifiersMismatch + @device_reachability_status_10_deviceStatusWithIdentifiersMismatch Scenario: Device reachabilityidentifiers mismatch # To test this, at least 2 types of identifiers have to be provided, e.g. a phoneNumber and the IP address of a Device reachability associated to a different phoneNumber - Given a valid devicestatus request body + Given a valid device reachability status request body And the request body property "$.device" includes several identifiers, each of them identifying a valid but different device When the request "getReachabilityStatus" is sent Then the response status code is 422 @@ -118,9 +126,9 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response property "$.code" is "DEVICE_IDENTIFIERS_MISMATCH" And the response property "$.message" contains a user friendly text - @device_reachability_status_10_deviceStatus_NotApplicable + @device_reachability_status_11_deviceStatus_NotApplicable Scenario: Device reachability not applicable - Given a valid devicestatus request body + Given a valid device reachability status request body And the request body property "$.device" refers to an unknown device When the request "getReachabilityStatus" is sent Then the response status code is 422 @@ -128,9 +136,9 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response property "$.code" is "DEVICE_NOT_APPLICABLE" And the response property "$.message" contains a user friendly text - @device_reachability_status_11_unable_to_provide_reachability_status + @device_reachability_status_12_unable_to_provide_reachability_status Scenario: Unable to provide reachability status for a device - Given a valid devicestatus request body + Given a valid device reachability status request body And the request body property "$.device" refers to a device having network issue When the request "getReachabilityStatus" is sent Then the response status code is 422 @@ -138,9 +146,9 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response property "$.code" is "UNABLE_TO_PROVIDE_REACHABILITY_STATUS" And the response property "$.message" contains a user friendly text - @device_reachability_status_12_unsupported_device_identifiers + @device_reachability_status_13_unsupported_device_identifiers Scenario: Unsupported device identifiers - Given a valid devicestatus request body + Given a valid device reachability status request body And the request body property "$.device" set to unsupported identifiers value for the service When the request "getReachabilityStatus" is sent Then the response status code is 422