From 68a38080b0f0f9612cb967db03cda5488de44b43 Mon Sep 17 00:00:00 2001 From: FedericoRuzzier <49512050+FedericoRuzzier@users.noreply.github.com> Date: Tue, 12 Mar 2024 10:57:14 +0100 Subject: [PATCH] PAGOPA-1494 adapting V2 to smoke and integration --- integration-test/src/config/.env.dev | 4 +++- integration-test/src/config/.env.local | 2 ++ integration-test/src/features/getFeesMulti.feature | 14 +++++++------- .../src/step_definitions/support/steps.js | 7 +++++++ 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/integration-test/src/config/.env.dev b/integration-test/src/config/.env.dev index 37739694..80d08423 100644 --- a/integration-test/src/config/.env.dev +++ b/integration-test/src/config/.env.dev @@ -1,4 +1,6 @@ AFM_HOST=https://api.dev.platform.pagopa.it/afm/calculator-service/v1 +AFM_HOST_V2=https://api.dev.platform.pagopa.it/afm/calculator-service/v2 +AFM_API_EXTENSION_V2=?maxOccurrences=10 ID_PSP_POSTE=BPPIITRRZZZ AMEX_ABI=AMREX -PSP_WHITELIST=PPAYITR1XXX,BPPIITRRXXX,CIPBITMM,UNCRITMM,BNLIITRR,BCITITMM,BIC36019 \ No newline at end of file +PSP_WHITELIST=PPAYITR1XXX,BPPIITRRXXX,CIPBITMM,UNCRITMM,BNLIITRR,BCITITMM,BIC36019 diff --git a/integration-test/src/config/.env.local b/integration-test/src/config/.env.local index c11eb550..bb1762ec 100644 --- a/integration-test/src/config/.env.local +++ b/integration-test/src/config/.env.local @@ -1,4 +1,6 @@ AFM_HOST=http://localhost:8080 +AFM_HOST_V2=http://localhost:8080 +AFM_API_EXTENSION_V2=/multi?maxOccurrences=10 ID_PSP_POSTE=BPPIITRRZZZ AMEX_ABI=AMREX PSP_WHITELIST=PPAYITR1XXX,BPPIITRRXXX,CIPBITMM,UNCRITMM,BNLIITRR,BCITITMM,BIC36019 diff --git a/integration-test/src/features/getFeesMulti.feature b/integration-test/src/features/getFeesMulti.feature index 681c00b9..70689db0 100644 --- a/integration-test/src/features/getFeesMulti.feature +++ b/integration-test/src/features/getFeesMulti.feature @@ -25,7 +25,7 @@ Feature: GetFees - Get List of fees by CI, amount, method, touchpoint ] } """ - When the client send POST to /fees/multi?maxOccurrences=10 + When the client send a V2 POST to /fees Then check statusCode is 200 And the body response for the bundleOptions.idsCiBundle field is: | idCiBundle | @@ -56,7 +56,7 @@ Feature: GetFees - Get List of fees by CI, amount, method, touchpoint ] } """ - When the client send POST to /fees/multi?maxOccurrences=10 + When the client send a V2 POST to /fees Then check statusCode is 200 And the body response for the bundleOptions.idsCiBundle field is: | idCiBundle | @@ -97,7 +97,7 @@ Feature: GetFees - Get List of fees by CI, amount, method, touchpoint ] } """ - When the client send POST to /fees/multi?maxOccurrences=10 + When the client send a V2 POST to /fees Then check statusCode is 200 And the body response for the bundleOptions.idsCiBundle field is: | idCiBundle | @@ -136,7 +136,7 @@ Feature: GetFees - Get List of fees by CI, amount, method, touchpoint ] } """ - When the client send POST to /fees/multi?maxOccurrences=10 + When the client send a V2 POST to /fees Then check statusCode is 200 And the body response for the bundleOptions.idsCiBundle field is: | idCiBundle | @@ -165,7 +165,7 @@ Feature: GetFees - Get List of fees by CI, amount, method, touchpoint ] } """ - When the client send POST to /fees/multi?maxOccurrences=10 + When the client send a V2 POST to /fees Then check statusCode is 200 And the body response for the bundleOptions.idsCiBundle field is: | idCiBundle | @@ -206,7 +206,7 @@ Feature: GetFees - Get List of fees by CI, amount, method, touchpoint ] } """ - When the client send POST to /fees/multi?maxOccurrences=10 + When the client send a V2 POST to /fees Then check statusCode is 200 And the body response for the bundleOptions.idsCiBundle field is: | idCiBundle1 | idCiBundle2 | @@ -247,7 +247,7 @@ Feature: GetFees - Get List of fees by CI, amount, method, touchpoint ] } """ - When the client send POST to /fees/multi?maxOccurrences=10 + When the client send a V2 POST to /fees Then check statusCode is 200 And the body response for the bundleOptions.idsCiBundle field is: | idCiBundle1 | idCiBundle2 | diff --git a/integration-test/src/step_definitions/support/steps.js b/integration-test/src/step_definitions/support/steps.js index bfc7e774..2b9cf696 100644 --- a/integration-test/src/step_definitions/support/steps.js +++ b/integration-test/src/step_definitions/support/steps.js @@ -6,6 +6,8 @@ const fs = require("fs"); const tableStorageClient = require("./table_storage_client"); const afm_host = process.env.AFM_HOST; +const afm_host_V2 = process.env.AFM_HOST_V2; +const afm_api_extension_V2 = process.env.AFM_API_EXTENSION_V2; /*increased the default timeout of the promise to allow the correct execution of the smoke tests*/ @@ -92,6 +94,11 @@ When(/^the client send (GET|POST|PUT|DELETE) to (.*)$/, responseToCheck = await call(method, afm_host + url, body) }); +When(/^the client send a V2 (GET|POST|PUT|DELETE) to (.*)$/, + async function(method, url) { + responseToCheck = await call(method, afm_host_V2 + url + afm_api_extension_V2, body) + }); + Then(/^check statusCode is (\d+)$/, function(status) { assert.strictEqual(responseToCheck.status, status);