From dea2ec7856d90e2d7d918161b17288ea4cbabb64 Mon Sep 17 00:00:00 2001 From: Ludovic Robert <30499179+bigludo7@users.noreply.github.com> Date: Tue, 25 Feb 2025 17:34:34 +0100 Subject: [PATCH 1/2] Added GENERIC_400_OUT_OF_RANGE --- code/API_definitions/sim-swap.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/API_definitions/sim-swap.yaml b/code/API_definitions/sim-swap.yaml index 1201692..ea1a889 100644 --- a/code/API_definitions/sim-swap.yaml +++ b/code/API_definitions/sim-swap.yaml @@ -288,6 +288,7 @@ components: code: enum: - INVALID_ARGUMENT + - OUT_OF_RANGE examples: GENERIC_400_INVALID_ARGUMENT: description: Invalid Argument. Generic Syntax Exception @@ -295,6 +296,12 @@ components: status: 400 code: INVALID_ARGUMENT message: Client specified an invalid argument, request body or query param. + GENERIC_400_OUT_OF_RANGE: + description: Out of Range. Specific Syntax Exception used when a given field has a pre-defined range or a invalid filter criteria combination is requested + value: + status: 400 + code: OUT_OF_RANGE + message: Client specified an invalid range. Generic401: description: Unauthorized headers: From 989d66a86a6d5dc5b22a335bf08868688457933c Mon Sep 17 00:00:00 2001 From: Ludovic Robert <30499179+bigludo7@users.noreply.github.com> Date: Tue, 25 Feb 2025 17:36:38 +0100 Subject: [PATCH 2/2] Added a TC for 400 OUT_OF_RANGE --- code/Test_definitions/sim-swap-check.feature | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/code/Test_definitions/sim-swap-check.feature b/code/Test_definitions/sim-swap-check.feature index d5f776a..8d4a8e2 100644 --- a/code/Test_definitions/sim-swap-check.feature +++ b/code/Test_definitions/sim-swap-check.feature @@ -188,3 +188,12 @@ Feature: CAMARA SIM Swap API, 2.0.0-rc.1 - Operation checkSimSwap 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 + + @check_sim_swap_400.3_invalid_max_age_value + Scenario: Check that the response shows an error when the max age is above the limit + Given the request body property "$.maxAge" is set to 100000 + When the request "checkSimSwap" is sent + Then the response status code is 400 + And the response property "$.status" is 400 + And the response property "$.code" is "OUT_OF_RANGE" + And the response property "$.message" contains a user friendly text