Skip to content

Commit

Permalink
Update device-reachability-status.feature
Browse files Browse the repository at this point in the history
  • Loading branch information
mdomale authored Aug 29, 2024
1 parent 188ec8e commit 81823ea
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions code/Test_definitions/device-reachability-status.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit 81823ea

Please sign in to comment.