From 81823ea0ac7b6f8c5a017986e6daabc5f4bc4a30 Mon Sep 17 00:00:00 2001 From: mdomale <125565716+mdomale@users.noreply.github.com> Date: Thu, 29 Aug 2024 12:33:18 +0530 Subject: [PATCH] Update device-reachability-status.feature --- .../device-reachability-status.feature | 30 +++++++------------ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/code/Test_definitions/device-reachability-status.feature b/code/Test_definitions/device-reachability-status.feature index 255ef5a..7e951ff 100644 --- a/code/Test_definitions/device-reachability-status.feature +++ b/code/Test_definitions/device-reachability-status.feature @@ -11,11 +11,11 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the header "Authorization" is set to a valid access token And the header "x-correlator" is set to a UUID value -#############Happy Path Scenarios################## +############# Happy Path Scenarios ################## @device_reachability_status_01_reachabilityStatusConnectedSms Scenario: Check the reachability status if device is connected with SMS - Given a valid devicestatus request body with "$.phoneNumber" + Given the request body property "$.phoneNumber" is set to valid value When the request "getReachabilityStatus" is sent Then the response code is 200 And the response header "Content-Type" is "application/json" @@ -50,12 +50,11 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi And the response property "$.code" is "OK" And the response property "$.reachabilityStatus" is "NOT_CONNECTED" - #############Error Response Scenarios################## @device_reachability_status_04_deviceStatus_with_invalid_parameter Scenario: Device reachability status request with invalid parameter - Given a valid devicestatus request body with invalid parameter + Given the request body is not compliant with the schema "/components/schemas/RequestReachabilityStatus" When the request "getReachabilityStatus" is sent Then Response code is 400 And the response property "$.status" is 400 @@ -65,7 +64,7 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi @device_reachability_status_05_expired_access_token Scenario: Expired access token Given a valid devicestatus request body and header "Authorization" is expired - When the request "getReachabilityStatus" is sent + When the request "getReachabilityStatus" is sent Then the response status code is 401 And the response property "$.status" is 401 And the response property "$.code" is "UNAUTHENTICATED" @@ -74,7 +73,7 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi @device_reachability_status_06_no_authorization_header Scenario: No Authorization header Given a valid devicestatus request body and header "Authorization" is not available - When the request "getReachabilityStatus" is sent + When the request "getReachabilityStatus" is sent Then the response status code is 401 And the response property "$.status" is 401 And the response property "$.code" is "UNAUTHENTICATED" @@ -92,28 +91,19 @@ Feature: CAMARA Device reachability status API, v0.6.0 - Operations for reachabi @device_reachability_status_08_deviceStatus_inconsistent_access_token Scenario: Inconsistent access token context for the device - # To test this, a token have to be obtained for a different device - Given a valid subscription request body with "$.phoneNumber" and token from different device + # To test this, a token has to be obtained for a different device + Given a valid devicestatus request body with token from different device + And the request body property "$.device" is set to appropriate value When the request "getReachabilityStatus" is sent Then the response status code is 403 And the response property "$.status" is 403 And the response property "$.code" is "INVALID_TOKEN_CONTEXT" And the response property "$.message" contains a user friendly text - - @device_reachability_status_09_deviceStatusWithIncorrectHTTPMethod - Scenario: Device reachabilitystatus request with incorrect HTTP request method - Given a valid devicestatus request body with "$.phoneNumber" - When the "PUT" request "getReachabilityStatus" is sent - Then Response code is 405 - And the response property "$.status" is 405 - And the response property "$.code" is "Method_Not_Allowed" - And the response property "$.message" contains a user friendly text - @device_reachability_status_10_deviceStatusWithIdentifiersMismatch + @device_reachability_status_09_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 with "$.phoneNumber" and config_var "identifier_types_unsupported" contains at least 2 items - And the request body property "$.device" includes several identifiers, each of them identifying a valid but different device + Given a valid devicestatus request body with 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 And the response property "$.status" is 422