Skip to content

Commit

Permalink
Phone Number retrieval and Testing
Browse files Browse the repository at this point in the history
Phone Number retrieval and Testing: #131

This Commit doesn't fix the other error codes. this will be addressed by: #123
  • Loading branch information
FabrizioMoggio authored Dec 19, 2024
1 parent 251e640 commit d4ca5b6
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Feature: CAMARA Call Fowarwing Signal API, v0.2.0 - Operation call-forwardings
Feature: CAMARA Call Fowarwing Signal API, v1.0.0 - Operation call-forwardings
# Input to be provided by the implementation to the tester
#
# Implementation indications:
Expand All @@ -17,32 +17,42 @@ Feature: CAMARA Call Fowarwing Signal API, v0.2.0 - Operation call-forwardings
# Happy path scenarios

# This first scenario serves as a minimum
@call_forwarding_signal_01_generic_success_scenario
Scenario: Common validations for any success scenario
@call_forwarding_signal_01_generic_success_scenario_2-legs
Scenario: Common validations for any success scenario with 2-legs authentication
# Valid testing default request body compliant with the schema
Given the request body property "$.phoneNumber" is set to a valid phone number supported by the service
And the request body is set to a valid request body
And "login_hint" is valorised as "$.phoneNumber"
When the HTTP "POST" request is sent
Then 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/UnconditionalCallForwardingSignal"
And the response body complies with the OAS schema at "/components/schemas/CallForwardingSignal"

@call_forwarding_signal_01.1_generic_success_scenario_3-legs
Scenario: Common validations for any success scenario with 3-legs authentication
# Valid testing default request body compliant with the schema
Given the request body is set to a valid request body
And the phone number is retrieved from "login_hint"
When the HTTP "POST" request is sent
Then 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/CallForwardingSignal"

#CFS inactive: phone number defined by phoneNumber and login_hint and the CFS status for the phone number is known by the network.
@call_forwarding_signal_02_call_forwarding_check_not_active_phoneNumber_login_hint
Scenario: retrieve the call forwarding service settings for a given phone number with no forwarding configured. The endpoint is invoked with phoneNumber valorised with the same value of login_hint
#CFS inactive: phone number defined by phoneNumber (2-legs authentication) and the CFS status for the phone number is known by the network.
@call_forwarding_signal_02_call_forwarding_check_not_active_phoneNumber
Scenario: retrieve the call forwarding service settings for a given phone number with no forwarding configured. The endpoint is invoked with phoneNumber properly valorised
Given the request body property "$.phoneNumber" is set to a valid phone number for which the call forwarding service status could be retrieved
And "login_hint" is valorised as "$.phoneNumber"
And the request body is set to a valid request body
When the HTTP "POST" request is sent
Then 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 body is a string with the value "inactive"

#CFS inactive: phone number defined by login_hint and the CFS status for the phone number is known by the network. phoneNumber not valorised
#CFS inactive: phone number defined by login_hint (3-legs authentication) and the CFS status for the phone number is known by the network. phoneNumber not valorised
@call_forwarding_signal_03_call_forwarding_check_not_active_login_hint
Scenario: retrieve the call forwarding service settings for a given phone number with call forwarding configured. The endpoint is invoked without a value for phoneNumber and login_hint is used to carry the phone number.
Given the request body property "$.phoneNumber" is not valorised
Expand All @@ -54,19 +64,18 @@ Feature: CAMARA Call Fowarwing Signal API, v0.2.0 - Operation call-forwardings
And the response header "x-correlator" has same value as the request header "x-correlator"
And the response body is a string with the value "inactive"

#CFS active: phone number defined by phoneNumber and login_hint and the CFS status for the phone number is known by the network.
@call_forwarding_signal_04_call_forwarding_check_active_phoneNumber_login_hint
Scenario: retrieve the call forwarding service settings for a given phone number with call forwarding configured. The endpoint is invoked with phoneNumber valorised with the same value of login_hint
#CFS active: phone number defined by phoneNumber (2-legs authentication) and the CFS status for the phone number is known by the network.
@call_forwarding_signal_04_call_forwarding_check_active_phoneNumber
Scenario: retrieve the call forwarding service settings for a given phone number with call forwarding configured. The endpoint is invoked with phoneNumber properly valorised
Given the request body property "$.phoneNumber" is set to a valid phone number for which the call forwarding service status could be retrieved
And "login_hint" is valorised as "$.phoneNumber"
And the request body is set to a valid request body
When the HTTP "POST" request is sent
Then 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 body is an array of strings with the possibile values ["unconditional", "conditional_no_reply", "conditional_unavailable", "conditional_busy"]

#CFS active: phone number defined by login_hint and the CFS status for the phone number is known by the network. phoneNumber not valorised
#CFS active: phone number defined by login_hint (3-legs authentication) and the CFS status for the phone number is known by the network. phoneNumber not valorised
@call_forwarding_signal_05_call_forwarding_check_active_login_hint
Scenario: retrieve the call forwarding service settings for a given phone number with call forwarding configured. The endpoint is invoked without a value for phoneNumber and login_hint is used to carry the phone number.
Given the request body property "$.phoneNumber" is not valorised
Expand Down Expand Up @@ -171,15 +180,24 @@ Feature: CAMARA Call Fowarwing Signal API, v0.2.0 - Operation call-forwardings
And the response property "$.code" is "UNSUPPORTED_MEDIA_TYPE"
And the response property "$.message" contains a user friendly text

# Generic 422 error - phone number unavailable
@call_forwarding_signal_422.phone_number_unavailable
Scenario: The "phoneNumber" parameter is not included in the request and the phone number information cannot be derived from the 3-legged access token
Given "login_hint" is not providing the phone number
And the request body property "$.phoneNumber" is not valorised
# Generic 422 error - phone number unavailable or unnecessary
@call_forwarding_signal_422.phone_number_unavailable_2-legs
Scenario: The "phoneNumber" parameter is not included in the request
Given the request body property "$.phoneNumber" is not valorised
When the HTTP "POST" request is sent
Then the response status code is 422
And the response property "$.status" is 422
And the response property "$.code" is "UNIDENTIFIABLE_DEVICE"
And the response property "$.code" is "MISSING_IDENTIFIER"
And the response property "$.message" contains a user friendly text

@call_forwarding_signal_422.1.phone_number_unnecessary_3-legs
Scenario: The "phoneNumber" parameter is included in the request
Given the request body property "$.phoneNumber" is valorised
And "login_hint" is set to a properly formatted phone number
When the HTTP "POST" request is sent
Then the response status code is 422
And the response property "$.status" is 422
And the response property "$.code" is "UNNECESSARY_IDENTIFIER"
And the response property "$.message" contains a user friendly text

# Generic 429 error - too many requests
Expand Down Expand Up @@ -212,4 +230,4 @@ Feature: CAMARA Call Fowarwing Signal API, v0.2.0 - Operation call-forwardings
Then the response status code is 501
And the response property "$.status" is 501
And the response property "$.code" is "NOT_IMPLEMENTED"
And the response property "$.message" contains a user friendly text
And the response property "$.message" contains a user friendly text
47 changes: 33 additions & 14 deletions code/Test_definitions/call-forwarding-signal-unconditional.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Feature: CAMARA Call Fowarwing Signal API, v0.2.0 - Operation unconditional-call-forwarding
Feature: CAMARA Call Fowarwing Signal API, v1.0.0 - Operation unconditional-call-forwarding
# Input to be provided by the implementation to the tester
#
# Implementation indications:
Expand All @@ -17,25 +17,35 @@ Feature: CAMARA Call Fowarwing Signal API, v0.2.0 - Operation unconditional-cal
# Happy path scenarios

# This first scenario serves as a minimum
@call_forwarding_signal_01_unconditional_generic_success_scenario
Scenario: Common validations for any success scenario
@call_forwarding_signal_01_unconditional_generic_success_scenario_2-legs
Scenario: Common validations for any success scenario with 2-legs authentication
# Valid testing default request body compliant with the schema
Given the request body property "$.phoneNumber" is set to a valid phone number supported by the service
And the request body is set to a valid request body
And "login_hint" is valorised as "$.phoneNumber"
When the HTTP "POST" request is sent
Then 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/UnconditionalCallForwardingSignal"

@call_forwarding_signal_01.1_generic_success_scenario_3-legs
Scenario: Common validations for any success scenario with 3-legs authentication
# Valid testing default request body compliant with the schema
Given the request body is set to a valid request body
And the phone number is retrieved from "login_hint"
When the HTTP "POST" request is sent
Then 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/UnconditionalCallForwardingSignal"

# phone number defined by phoneNumber and login_hint and the CFS status for the phone number is known by the network.
@call_forwarding_signal_02_unconditional_phoneNumber_login_hint
Scenario: retrieve unconditional call forwarding settings for a given phone number. The endpoint is invoked with phoneNumber valorised with the same value of login_hint
# phone number defined by phoneNumber (2-legs authentication) and the CFS status for the phone number is known by the network.
@call_forwarding_signal_02_unconditional_phoneNumber
Scenario: retrieve unconditional call forwarding settings for a given phone number. The endpoint is invoked with phoneNumber properly valorised
Given the request body property "$.phoneNumber" is set to a valid phone number supported by the service
And the request body is set to a valid request body
And "login_hint" is valorised as "$.phoneNumber"
When the HTTP "POST" request is sent
Then the response status code is 200
And the response header "Content-Type" is "application/json"
Expand Down Expand Up @@ -148,14 +158,23 @@ Feature: CAMARA Call Fowarwing Signal API, v0.2.0 - Operation unconditional-cal
And the response property "$.message" contains a user friendly text

# Generic 422 error - phone number unavailable
@call_forwarding_signal_422.phone_number_unavailable
Scenario: The "phoneNumber" parameter is not included in the request and the phone number information cannot be derived from the 3-legged access token
Given "login_hint" is not providing the phone number
And the request body property "$.phoneNumber" is not valorised
@call_forwarding_signal_422.phone_number_unavailable_2-legs
Scenario: The "phoneNumber" parameter is not included in the request
Given the request body property "$.phoneNumber" is not valorised
When the HTTP "POST" request is sent
Then the response status code is 422
And the response property "$.status" is 422
And the response property "$.code" is "UNIDENTIFIABLE_DEVICE"
And the response property "$.code" is "MISSING_IDENTIFIER"
And the response property "$.message" contains a user friendly text

@call_forwarding_signal_422.1.phone_number_unnecessary_3-legs
Scenario: The "phoneNumber" parameter is included in the request
Given the request body property "$.phoneNumber" is valorised
And "login_hint" is set to a properly formatted phone number
When the HTTP "POST" request is sent
Then the response status code is 422
And the response property "$.status" is 422
And the response property "$.code" is "UNNECESSARY_IDENTIFIER"
And the response property "$.message" contains a user friendly text

# Generic 429 error - too many requests
Expand All @@ -177,4 +196,4 @@ Feature: CAMARA Call Fowarwing Signal API, v0.2.0 - Operation unconditional-cal
Then the response status code is 429
And the response property "$.status" is 429
And the response property "$.code" is "TOO_MANY_REQUEST"
And the response property "$.message" contains a user friendly text
And the response property "$.message" contains a user friendly text

0 comments on commit d4ca5b6

Please sign in to comment.