Skip to content

Commit

Permalink
PAGOPA-1494 adapting V2 to smoke and integration
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoRuzzier committed Mar 12, 2024
1 parent 24611cb commit 68a3808
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
4 changes: 3 additions & 1 deletion integration-test/src/config/.env.dev
Original file line number Diff line number Diff line change
@@ -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
PSP_WHITELIST=PPAYITR1XXX,BPPIITRRXXX,CIPBITMM,UNCRITMM,BNLIITRR,BCITITMM,BIC36019
2 changes: 2 additions & 0 deletions integration-test/src/config/.env.local
Original file line number Diff line number Diff line change
@@ -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
14 changes: 7 additions & 7 deletions integration-test/src/features/getFeesMulti.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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 |
Expand Down Expand Up @@ -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 |
Expand Down Expand Up @@ -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 |
Expand Down Expand Up @@ -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 |
Expand Down Expand Up @@ -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 |
Expand Down Expand Up @@ -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 |
Expand Down
7 changes: 7 additions & 0 deletions integration-test/src/step_definitions/support/steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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*/
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 68a3808

Please sign in to comment.