Skip to content

Commit

Permalink
Merge pull request #80 from bigludo7/main
Browse files Browse the repository at this point in the history
Remove 405 error code in the yaml & test definition
  • Loading branch information
bigludo7 authored Aug 22, 2024
2 parents f16319b + 5a8c9c9 commit f88cd4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 49 deletions.
21 changes: 1 addition & 20 deletions code/API_definitions/one-time-password-sms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ info:
It is important to remark that in cases where personal user data is processed by the API, and users can exercise their rights through mechanisms such as opt-in and/or opt-out, the use of 3-legged access tokens becomes mandatory. This measure ensures that the API remains in strict compliance with user privacy preferences and regulatory obligations, upholding the principles of transparency and user-centric data control.
version: 1.0.0-rc.1
version: wip
x-camara-commonalities: 0.4.0
license:
name: Apache 2.0
Expand Down Expand Up @@ -77,8 +77,6 @@ paths:
$ref: '#/components/responses/SendCodeForbiddenError403'
'404':
$ref: '#/components/responses/Generic404'
'405':
$ref: '#/components/responses/Generic405'
'406':
$ref: '#/components/responses/Generic406'
'415':
Expand Down Expand Up @@ -131,8 +129,6 @@ paths:
$ref: '#/components/responses/Generic403'
'404':
$ref: '#/components/responses/Generic404'
'405':
$ref: '#/components/responses/Generic405'
'406':
$ref: '#/components/responses/Generic406'
'415':
Expand Down Expand Up @@ -356,21 +352,6 @@ components:
status: 404
code: NOT_FOUND
message: A specified resource is not found
Generic405:
description: The requested method is not allowed/supported on the target resource
headers:
x-correlator:
description: Correlation id for the different services
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorInfo'
example:
status: 405
code: METHOD_NOT_ALLOWED
message: The requested method is not allowed/supported on the target resource
Generic406:
description: The server can not produce a response matching the content
headers:
Expand Down
31 changes: 2 additions & 29 deletions code/Test_Definitions/OTPvalidationAPI.feature
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Scenario: Validation for sucess validate-code scenario without x-correlator
And the response header "x-correlator" has same value as the request header "x-correlator"

# Following part describe scenario to test error code defined in the yaml
# These scenarios cover following http status: 400, 401, 404, 405, 406, 415
# These scenarios cover following http status: 400, 401, 404, 406, 415

# Following error code is not managed in scenarios
# -429 as it could not be easily tested
Expand Down Expand Up @@ -251,21 +251,7 @@ Scenario: Validation for sucess validate-code scenario without x-correlator
And the response property "$.code" is "NOT_FOUND"
And the response property "$.message" contains a user friendly text
And the response header "x-correlator" has same value as the request header "x-correlator"

###########################
# 405 errors for send_code
###########################

@OTPvalidationAPI_405.1_send_code_method_not_allowed
Scenario: method not allowed
# As API Gateway can prevent this test by restricting path/routes this test should be considered as optional
Given the request body property "$.phoneNumber" is set to config_var: "phone_number"
And the request body property "$.message" is set to config_var: "message"
And the resource "/one-time-password-sms/v0/send-code"
When the HTTP "GET" request is sent
Then the response property "$.status" is 405
And the response header "x-correlator" has same value as the request header "x-correlator"
And the response property "$.message" contains a user friendly text

###########################
# 406 errors for send_code
Expand Down Expand Up @@ -363,7 +349,7 @@ Scenario: Validations for verification failed validate-code scenario whe maximu
And the response header "x-correlator" has same value as the request header "x-correlator"

# Following part describe scenario to test error code defined in the yaml
# These scenarios cover following http status: 400, 401, 404, 405, 406, 415
# These scenarios cover following http status: 400, 401, 404, 406, 415

# Following error code is not managed in scenarios
# -429 as it could not be easily tested
Expand Down Expand Up @@ -483,19 +469,6 @@ Scenario: Validations for verification failed validate-code scenario whe maximu
And the response header "x-correlator" has same value as the request header "x-correlator"
And the response property "$.message" contains a user friendly text

###############################
# 405 errors for validate_code
###############################

@OTPvalidationAPI_405_validate_code_method_not_allowed
Scenario: method not allowed
# As API Gateway can prevent this test by restricting path/routes this test should be considered as optional
Given an authenticationId has been retrieved from a send-code request
And the request body property "$.code" is set to the value received in the SMS
And the resource "/one-time-password-sms/v0/validate-code"
When the HTTP "GET" request is sent
Then the response property "$.status" is 405
And the response header "x-correlator" has same value as the request header "x-correlator"

###############################
# 406 errors for validate_code
Expand Down

0 comments on commit f88cd4e

Please sign in to comment.