Skip to content

Commit

Permalink
updates_after_1st_review
Browse files Browse the repository at this point in the history
  • Loading branch information
PedroDiez committed Aug 27, 2024
1 parent 7095def commit 7bfb47f
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 24 deletions.
6 changes: 4 additions & 2 deletions code/Test_definitions/carrier-billing-cancelPayment.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation cancelPayment
@cancel_payment_01_generic_success_scenario
Scenario: Common validations for any success scenario
# Valid default request body compliant with the schema
And the request body is set to a valid request body
Given the request body is set to a valid request body
When the HTTP "POST" request is sent
Then the response status code is 202
And the response header "Content-Type" is "application/json"
Expand All @@ -43,7 +43,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation cancelPayment


@cancel_payment_03_phoneNumber_two_legged
# Case using a 2-legged Access Token. Only applicable for Countries and Telcp Operators whose regulation allows for it
# Case using a 2-legged Access Token. Only applicable for Countries and Telco Operators whose regulation allows for it
Scenario: Request cancel payment indicating phoneNumber
Given the request body property "$.phonenumber" is set to a valid value which is the same as associated to access token
When the HTTP "POST" request is sent
Expand Down Expand Up @@ -90,6 +90,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation cancelPayment
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


@cancel_payment_401.02_expired_access_token
Scenario: Expired access token
Given the header "Authorization" is set to an expired access token
Expand All @@ -100,6 +101,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation cancelPayment
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


@cancel_payment_401.03_invalid_access_token
Scenario: Invalid access token
Given the header "Authorization" is set to an invalid access token
Expand Down
8 changes: 5 additions & 3 deletions code/Test_definitions/carrier-billing-confirmPayment.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation confirmPayment
@confirm_payment_01_generic_success_scenario
Scenario: Common validations for any success scenario
# Valid default request body compliant with the schema
And the request body is set to a valid request body
Given the request body is set to a valid request body
When the HTTP "POST" request is sent
Then the response status code is 202
And the response header "Content-Type" is "application/json"
Expand All @@ -44,7 +44,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation confirmPayment


@confirm_payment_03_phoneNumber_two_legged
# Case using a 2-legged Access Token. Only applicable for Countries and Telcp Operators whose regulation allows for it
# Case using a 2-legged Access Token. Only applicable for Countries and Telco Operators whose regulation allows for it
Scenario: Request confirm payment indicating phoneNumber
Given the request body property "$.phonenumber" is set to a valid value which is the same as associated to access token
When the HTTP "POST" request is sent
Expand Down Expand Up @@ -91,6 +91,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation confirmPayment
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


@confirm_payment_401.02_expired_access_token
Scenario: Expired access token
Given the header "Authorization" is set to an expired access token
Expand All @@ -101,6 +102,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation confirmPayment
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


@confirm_payment_401.03_invalid_access_token
Scenario: Invalid access token
Given the header "Authorization" is set to an invalid access token
Expand Down Expand Up @@ -147,7 +149,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation confirmPayment
When the HTTP "POST" request is sent
Then the response status code is 403
And the response property "$.status" is 403
And the response property "$.code" is "PAYMENT_DENIED"
And the response property "$.code" is "CARRIER_BILLING.PAYMENT_DENIED"
And the response property "$.message" contains a user friendly text


Expand Down
8 changes: 5 additions & 3 deletions code/Test_definitions/carrier-billing-createPayment.feature
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation createPayment


@create_payment_11_amountTransaction_phoneNumber_two_legged
# Case using a 2-legged Access Token. Only applicable for Countries and Telcp Operators whose regulation allows for it
# Case using a 2-legged Access Token. Only applicable for Countries and Telco Operators whose regulation allows for it
Scenario: Request 1-step payment indicating phoneNumber
Given the request body property "$.amountTransaction" is set with valid required information
And the request body property "$.amountTransaction.phoneNumber" is set to a valid value
Expand Down Expand Up @@ -268,7 +268,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation createPayment

@create_payment_400.06_invalid_sink
Scenario: Using a invalid sink value
Given the request body property includes property "$.sink" with an HTTP endpoint
Given the request body property includes property "$.sink" which is not set to an url
When the HTTP "POST" request is sent
Then the response status code is 400
And the response property "$.status" is 400
Expand Down Expand Up @@ -307,6 +307,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation createPayment
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


@create_payment_401.02_expired_access_token
Scenario: Expired access token
Given the header "Authorization" is set to an expired access token
Expand All @@ -317,6 +318,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation createPayment
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


@create_payment_401.03_invalid_access_token
Scenario: Invalid access token
Given the header "Authorization" is set to an invalid access token
Expand Down Expand Up @@ -363,7 +365,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation createPayment
When the HTTP "POST" request is sent
Then the response status code is 403
And the response property "$.status" is 403
And the response property "$.code" is "PAYMENT_DENIED"
And the response property "$.code" is "CARRIER_BILLING.PAYMENT_DENIED"
And the response property "$.message" contains a user friendly text


Expand Down
34 changes: 18 additions & 16 deletions code/Test_definitions/carrier-billing-preparePayment.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation preparePayment
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/PaymentCreated"
And the response body complies with the OAS schema at "/components/schemas/BodyAmountReservationTransactionForReserve"


@prepare_payment_02_generic_success_scenario_with_sink_information
Expand All @@ -48,7 +48,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation preparePayment
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/PaymentCreated"
And the response body complies with the OAS schema at "/components/schemas/BodyAmountReservationTransactionForReserve"


@prepare_payment_03_generic_success_scenario_with_sink_and_sinkCredential_information
Expand All @@ -65,7 +65,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation preparePayment
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/PaymentCreated"
And the response body complies with the OAS schema at "/components/schemas/BodyAmountReservationTransactionForReserve"


# Scenarios testing specific situations for amountTransaction
Expand All @@ -78,7 +78,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation preparePayment
Then the response status code is 201
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/PaymentCreated"
And the response body complies with the OAS schema at "/components/schemas/BodyAmountReservationTransactionForReserve"
And the response body property "$.amountTransaction.paymentAmount.chargingInformation.isTaxIncluded" is true


Expand All @@ -90,7 +90,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation preparePayment
Then the response status code is 201
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/PaymentCreated"
And the response body complies with the OAS schema at "/components/schemas/BodyAmountReservationTransactionForReserve"
And the response body property "$.amountTransaction.paymentAmount.chargingInformation.isTaxIncluded" is false OR not returned


Expand All @@ -102,7 +102,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation preparePayment
Then the response status code is 201
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/PaymentCreated"
And the response body complies with the OAS schema at "/components/schemas/BodyAmountReservationTransactionForReserve"
And the response body property "$.amountTransaction.paymentAmount.chargingInformation.taxAmount" has the same value as provided in the request body


Expand All @@ -115,7 +115,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation preparePayment
Then the response status code is 201
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/PaymentCreated"
And the response body complies with the OAS schema at "/components/schemas/BodyAmountReservationTransactionForReserve"
And the response body property "$.amountTransaction.paymentAmount.chargingMetaData.merchantIdentifier" has the same value as provided in the request body


Expand All @@ -127,7 +127,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation preparePayment
Then the response status code is 201
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/PaymentCreated"
And the response body complies with the OAS schema at "/components/schemas/BodyAmountReservationTransactionForReserve"
And the response body array property "$.amountTransaction.paymentAmount.paymentDetails" has the same information as provided in the request body


Expand All @@ -140,7 +140,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation preparePayment
Then the response status code is 201
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/PaymentCreated"
And the response body complies with the OAS schema at "/components/schemas/BodyAmountReservationTransactionForReserve"
And the response body property "$.amountTransaction.clientCorrelator" has the same value as provided in the request body


Expand All @@ -153,7 +153,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation preparePayment
Then the response status code is 201
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/PaymentCreated"
And the response body complies with the OAS schema at "/components/schemas/BodyAmountReservationTransactionForReserve"
And the response body property "$.amountTransaction.phoneNumber" has the same value as provided in the request body


Expand All @@ -166,7 +166,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation preparePayment
Then the response status code is 201
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/PaymentCreated"
And the response body complies with the OAS schema at "/components/schemas/BodyAmountReservationTransactionForReserve"
And the response body property "$.amountTransaction.phoneNumber" has the same value as provided in the request body


Expand All @@ -178,7 +178,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation preparePayment
Then the response status code is 201
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/PaymentCreated"
And the response body complies with the OAS schema at "/components/schemas/BodyAmountReservationTransactionForReserve"
And the response property "$.validatioInfo" is not returned
And the response body property "$.paymentStatus" is "reserved"

Expand All @@ -191,7 +191,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation preparePayment
Then the response status code is 201
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/PaymentCreated"
And the response body complies with the OAS schema at "/components/schemas/BodyAmountReservationTransactionForReserve"
And the response property "$.validatioInfo" is returned
And the response body property "$.paymentStatus" is "pending_validation"

Expand All @@ -204,7 +204,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation preparePayment
Then the response status code is 201
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/PaymentCreated"
And the response body complies with the OAS schema at "/components/schemas/BodyAmountReservationTransactionForReserve"
And the response body property "$.paymentStatus" is "processing"


Expand Down Expand Up @@ -282,7 +282,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation preparePayment

@prepare_payment_400.06_invalid_sink
Scenario: Using a invalid sink value
Given the request body property includes property "$.sink" with an HTTP endpoint
Given the request body property includes property "$.sink" which is not set to an url
When the HTTP "POST" request is sent
Then the response status code is 400
And the response property "$.status" is 400
Expand Down Expand Up @@ -321,6 +321,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation preparePayment
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


@prepare_payment_401.02_expired_access_token
Scenario: Expired access token
Given the header "Authorization" is set to an expired access token
Expand All @@ -331,6 +332,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation preparePayment
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


@prepare_payment_401.03_invalid_access_token
Scenario: Invalid access token
Given the header "Authorization" is set to an invalid access token
Expand Down Expand Up @@ -377,7 +379,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation preparePayment
When the HTTP "POST" request is sent
Then the response status code is 403
And the response property "$.status" is 403
And the response property "$.code" is "PAYMENT_DENIED"
And the response property "$.code" is "CARRIER_BILLING.PAYMENT_DENIED"
And the response property "$.message" contains a user friendly text


Expand Down
2 changes: 2 additions & 0 deletions code/Test_definitions/carrier-billing-validatePayment.feature
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation validatePayment
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


@validate_payment_401.02_expired_access_token
Scenario: Expired access token
Given the header "Authorization" is set to an expired access token
Expand All @@ -134,6 +135,7 @@ Feature: CAMARA Carrier Billing API, v0.3 - Operation validatePayment
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text


@validate_payment_401.03_invalid_access_token
Scenario: Invalid access token
Given the header "Authorization" is set to an invalid access token
Expand Down

0 comments on commit 7bfb47f

Please sign in to comment.