Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gherkin-lintrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"no-multiple-empty-lines": "on",
"no-empty-file": "on",
"no-scenario-outlines-without-examples": "on",
"name-length": ["on", {"Feature": 90, "Step": 190, "Scenario": 190}],
"name-length": ["on", {"Feature": 190, "Step": 190, "Scenario": 190}],
"no-restricted-tags": ["on", {"tags": ["@watch", "@wip"]}],
"use-and": "on",
"keywords-in-logical-order": "on",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
Feature: CAMARA Blockchain Public Address Validation API, vwip - Operation createBlockchainPublicAddressValidationNonce
# Input to be provided by the implementation to the tester
#
# Implementation indications:
#
#
# Testing assets:
# * A valid blockchainPublicAddress in order to be able to generate nonces
#
#
# References to OAS spec schemas refer to schemas specifies in blockchain-public-address-validation.yaml, version wip

Background: Common createBlockchainPublicAddressValidationNonce setup
Given the resource "/blockchain-public-address-validation/vwip/blockchain-public-addresses"
And the header "Content-Type" is set to "application/json"
And the header "Authorization" is set to a valid access token
And the header "x-correlator" complies with the schema at "#/components/schemas/XCorrelator"
And the request body is set by default to a request body compliant with the schema

##############################
# Happy path scenarios
##############################

@create_blockchain_public_address_validation_nonce_01_generic_success_scenario
Scenario: Common validations for any success scenario
# Valid default request body compliant with the schema
Given the request body property "$.blockchainPublicAddress" is set with a valid value
And the request body is set to a valid request body
When the request "createBlockchainPublicAddressValidationNonce" is sent
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"
# 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/CreateBlockchainPublicAddressValidationNonceResponse"

##############################
# Error scenarios
##############################

# Error 400 scenarios

@create_blockchain_public_address_validation_nonce_400.01_no_request_body
Scenario: Missing request body
Given the request body is not included
When the request "createBlockchainPublicAddressValidationNonce" is sent
Then the response status code is 400
And the response property "$.status" is 400
And the response property "$.code" is "INVALID_ARGUMENT"
And the response property "$.message" contains a user friendly text

@create_blockchain_public_address_validation_nonce_400.02_empty_request_body
Scenario: Empty object as request body
Given the request body is set to "{}"
When the request "createBlockchainPublicAddressValidationNonce" is sent
Then the response status code is 400
And the response property "$.status" is 400
And the response property "$.code" is "INVALID_ARGUMENT"
And the response property "$.message" contains a user friendly text

@create_blockchain_public_address_validation_nonce_400.03_invalid_blockchainPublicAddress
Scenario: Using a invalid blockchainPublicAddress value
Given the request body property includes property "$.blockchainPublicAddress" with a not valid value
When the request "createBlockchainPublicAddressValidationNonce" is sent
Then the response status code is 400
And the response property "$.status" is 400
And the response property "$.code" is "INVALID_ARGUMENT"
And the response property "$.message" contains a user friendly text

@create_blockchain_public_address_validation_nonce_400.04_invalid_x-correlator
Scenario: Invalid x-correlator header
Given the header "x-correlator" does not comply with the schema at "#/components/schemas/XCorrelator"
And the request body is set to a valid request body
When the request "createBlockchainPublicAddressValidationNonce" is sent
Then the response status code is 400
And the response property "$.status" is 400
And the response property "$.code" is "INVALID_ARGUMENT"

# Error 401 scenarios

@create_blockchain_public_address_validation_nonce_401.01_no_authorization_header
Scenario: No Authorization header
Given the header "Authorization" is removed
And the request body is set to a valid request body
When the request "createBlockchainPublicAddressValidationNonce" is sent
Then the response status code is 401
And the response property "$.status" is 401
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text

@create_blockchain_public_address_validation_nonce_401.02_expired_access_token
Scenario: Expired access token
Given the header "Authorization" is set to an expired access token
And the request body is set to a valid request body
When the request "createBlockchainPublicAddressValidationNonce" is sent
Then the response status code is 401
And the response property "$.status" is 401
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text

@create_blockchain_public_address_validation_nonce_401.03_invalid_access_token
Scenario: Invalid access token
Given the header "Authorization" is set to an invalid access token
And the request body is set to a valid request body
When the request "createBlockchainPublicAddressValidationNonce" is sent
Then the response status code is 401
And the response header "Content-Type" is "application/json"
And the response property "$.status" is 401
And the response property "$.code" is "UNAUTHENTICATED"
And the response property "$.message" contains a user friendly text

# Error 403 scenarios

@create_blockchain_public_address_validation_nonce_403.01_invalid_token_permissions
Scenario: Inconsistent access token permissions
# To test this scenario, it will be necessary to obtain a token without the required scope
Given the request body is set to a valid request body
And the header "Authorization" is set to an access token without the required scope
When the request "createBlockchainPublicAddressValidationNonce" is sent
Then the response status code is 403
And the response property "$.status" is 403
And the response property "$.code" is "PERMISSION_DENIED"
And the response property "$.message" contains a user friendly text

##############################
##END
##############################