From b43a52490ef9673ec5da95e20ed6d5f93bbaab4c Mon Sep 17 00:00:00 2001 From: alessio-acitelli <97529051+alessio-acitelli@users.noreply.github.com> Date: Fri, 27 Oct 2023 15:47:13 +0200 Subject: [PATCH] feat: [PAGOPA-1299] update amex abi (#112) * [PAGOPA-1299] update amex abi: updated tests with new amex abi * [PAGOPA-1299] update amex abi: fixed the int tests for the new onus order * [PAGOPA-1299] formatting * [PAGOPA-1299] formatting --------- Co-authored-by: pagopa-github-bot Co-authored-by: aacitelli Co-authored-by: Jacopo --- .github/workflows/check_pr.yml | 5 +++-- .github/workflows/update_code.yml | 19 ++++++++++++------- helm/values-dev.yaml | 2 +- helm/values-prod.yaml | 2 +- helm/values-uat.yaml | 2 +- integration-test/src/config/.env.dev | 2 +- integration-test/src/config/.env.local | 2 +- integration-test/src/config/.env.uat | 2 +- integration-test/src/config/data.json | 2 +- .../src/features/getFeeByPsp.feature | 8 ++++---- integration-test/src/features/getFees.feature | 8 ++++---- .../src/step_definitions/support/steps.js | 2 +- .../calculator/service/CalculatorService.java | 2 +- .../resources/application-local.properties | 2 +- .../gov/pagopa/afm/calculator/TestUtil.java | 2 +- .../service/CalculatorServiceTest.java | 2 +- src/test/resources/responses/getAmexFees.json | 2 +- 17 files changed, 36 insertions(+), 30 deletions(-) diff --git a/.github/workflows/check_pr.yml b/.github/workflows/check_pr.yml index 0abb3409..3f1ead5a 100644 --- a/.github/workflows/check_pr.yml +++ b/.github/workflows/check_pr.yml @@ -38,9 +38,10 @@ jobs: - name: Formatting id: format continue-on-error: true - uses: axel-op/googlejavaformat-action@v3 + uses: findologic/intellij-format-action@main with: - args: "--set-exit-if-changed" + path: . + fail-on-changes: false - uses: actions/github-script@v6.3.3 if: steps.format.outcome != 'success' diff --git a/.github/workflows/update_code.yml b/.github/workflows/update_code.yml index d1f88536..a4a8870b 100644 --- a/.github/workflows/update_code.yml +++ b/.github/workflows/update_code.yml @@ -19,12 +19,9 @@ jobs: - name: Checkout uses: actions/checkout@v3 with: + ref: ${{ github.ref }} token: ${{ secrets.BOT_TOKEN_GITHUB }} - - name: Checkout Pull Request - run: hub pr checkout ${{ github.event.issue.number }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set up JDK 11 uses: actions/setup-java@v1 with: @@ -41,10 +38,18 @@ jobs: # ./generate_openapi.sh - name: Formatting - uses: axel-op/googlejavaformat-action@v3 + id: format + uses: findologic/intellij-format-action@main with: - args: "--replace" - commit-message: "Google Java format [skip ci]" + path: . + fail-on-changes: false + + - name: Commit files + run: | + git config --local user.email "pagopa-github-bot@pagopa.it" + git config --local user.name "pagopa-github-bot" + git commit -a -m "Formatting [skip ci]" + git push notify: needs: [ update ] diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index 7c77f168..39856498 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -86,7 +86,7 @@ microservice-chart: ISSUER_RANGE_TABLE: 'pagopadweuafmsaissuerrangetable' AMOUNT_THRESHOLD: '0' ID_PSP_POSTE: 'BPPIITRRZZZ' - AMEX_ABI: '36019' + AMEX_ABI: 'AMREX' OTEL_SERVICE_NAME: "pagopa-afm-calculator" OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=dev" OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317" diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index 56b20cff..769fb04c 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -86,7 +86,7 @@ microservice-chart: ISSUER_RANGE_TABLE: 'pagopapweuafmsaissuerrangetable' AMOUNT_THRESHOLD: '0' ID_PSP_POSTE: 'BPPIITRRXXX' - AMEX_ABI: '36019' + AMEX_ABI: 'AMREX' OTEL_SERVICE_NAME: "pagopa-afm-calculator" OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=prod" OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317" diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index b760c41d..362e33fa 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -86,7 +86,7 @@ microservice-chart: ISSUER_RANGE_TABLE: 'pagopauweuafmsaissuerrangetable' AMOUNT_THRESHOLD: '0' ID_PSP_POSTE: 'BPPIITRRXXX' - AMEX_ABI: '36019' + AMEX_ABI: 'AMREX' OTEL_SERVICE_NAME: "pagopa-afm-calculator" OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=uat" OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317" diff --git a/integration-test/src/config/.env.dev b/integration-test/src/config/.env.dev index 67acaa3a..f725d14a 100644 --- a/integration-test/src/config/.env.dev +++ b/integration-test/src/config/.env.dev @@ -1,3 +1,3 @@ AFM_HOST=https://api.dev.platform.pagopa.it/afm/calculator-service/v1 ID_PSP_POSTE=BPPIITRRZZZ -AMEX_ABI=36019 \ No newline at end of file +AMEX_ABI=AMREX \ No newline at end of file diff --git a/integration-test/src/config/.env.local b/integration-test/src/config/.env.local index 84a23043..40f1e681 100644 --- a/integration-test/src/config/.env.local +++ b/integration-test/src/config/.env.local @@ -1,3 +1,3 @@ AFM_HOST=http://localhost:8080 ID_PSP_POSTE=BPPIITRRZZZ -AMEX_ABI=36019 +AMEX_ABI=AMREX diff --git a/integration-test/src/config/.env.uat b/integration-test/src/config/.env.uat index 780931ee..dd945b24 100644 --- a/integration-test/src/config/.env.uat +++ b/integration-test/src/config/.env.uat @@ -1,3 +1,3 @@ AFM_HOST=https://api.uat.platform.pagopa.it/afm/calculator-service/v1 ID_PSP_POSTE=BPPIITRRXXX -AMEX_ABI=36019 \ No newline at end of file +AMEX_ABI=AMREX \ No newline at end of file diff --git a/integration-test/src/config/data.json b/integration-test/src/config/data.json index 51ba4258..aafc3c9b 100644 --- a/integration-test/src/config/data.json +++ b/integration-test/src/config/data.json @@ -206,7 +206,7 @@ "validityDateTo": null, "touchpoint": "ANY", "paymentType": "CP", - "abi": 36019, + "abi": "AMREX", "pspBusinessName": "psp business name int-test-10" } ], diff --git a/integration-test/src/features/getFeeByPsp.feature b/integration-test/src/features/getFeeByPsp.feature index 06f66683..125a7c1a 100644 --- a/integration-test/src/features/getFeeByPsp.feature +++ b/integration-test/src/features/getFeeByPsp.feature @@ -101,11 +101,11 @@ Feature: GetFeeByPsp Then check statusCode is 200 And the body response ordering for the bundleOptions.onUs field is: | onUs | - | true | | false | | false | | false | | false | + | true | Scenario: Get List of fees by CI, amount, touchpoint and single PSP Given initial json @@ -131,11 +131,11 @@ Feature: GetFeeByPsp Then check statusCode is 200 And the body response ordering for the bundleOptions.onUs field is: | onUs | - | true | | false | | false | | false | | false | + | true | Scenario: Get List of fees by CI, amount, touchpoint and single PSP 2 Given initial json @@ -239,11 +239,11 @@ Feature: GetFeeByPsp Then check statusCode is 200 And the body response ordering for the bundleOptions.onUs field is: | onUs | - | true | | false | | false | | false | | false | + | true | Scenario: Get fee by psp with non-existing bin Given initial json @@ -316,7 +316,7 @@ Feature: GetFeeByPsp "idBrokerPsp": "88888888899", "idChannel": "AMEX_ONUS", "onUs": true, - "abi": "36019", + "abi": "AMREX", "pspBusinessName": "psp business name int-test-10" } ] diff --git a/integration-test/src/features/getFees.feature b/integration-test/src/features/getFees.feature index e3e90143..202e91f3 100644 --- a/integration-test/src/features/getFees.feature +++ b/integration-test/src/features/getFees.feature @@ -62,8 +62,8 @@ Feature: GetFees - Get List of fees by CI, amount, method, touchpoint And the body response ordering for the bundleOptions.onUs field is: | onUs | | true | - | true | | false | + | true | | false | | false | | false | @@ -96,11 +96,11 @@ Feature: GetFees - Get List of fees by CI, amount, method, touchpoint Then check statusCode is 200 And the body response ordering for the bundleOptions.onUs field is: | onUs | - | true | | false | | false | | false | | false | + | true | @@ -130,8 +130,8 @@ Feature: GetFees - Get List of fees by CI, amount, method, touchpoint Then check statusCode is 200 And the body response ordering for the bundleOptions.onUs field is: | onUs | - | true | | false | + | true | | false | @@ -245,8 +245,8 @@ Feature: GetFees - Get List of fees by CI, amount, method, touchpoint And the body response ordering for the bundleOptions.onUs field is: | onUs | | true | - | true | | false | + | true | | false | | false | | false | diff --git a/integration-test/src/step_definitions/support/steps.js b/integration-test/src/step_definitions/support/steps.js index c93ede5a..b0352f74 100644 --- a/integration-test/src/step_definitions/support/steps.js +++ b/integration-test/src/step_definitions/support/steps.js @@ -51,7 +51,7 @@ let isseuerEntity3 = { PRODUCT_TYPE: "3", PRODUCT_CATEGORY: "C", ISSUER_ID: "999999", - ABI: "36019" + ABI: "AMREX" }; // Synchronous diff --git a/src/main/java/it/gov/pagopa/afm/calculator/service/CalculatorService.java b/src/main/java/it/gov/pagopa/afm/calculator/service/CalculatorService.java index ef5db1dc..20756527 100644 --- a/src/main/java/it/gov/pagopa/afm/calculator/service/CalculatorService.java +++ b/src/main/java/it/gov/pagopa/afm/calculator/service/CalculatorService.java @@ -43,7 +43,7 @@ public class CalculatorService { @Autowired IssuersService issuersService; - @Value("${pspAmex.abi:36019}") + @Value("${pspAmex.abi:AMREX}") private String amexABI; @Cacheable(value = "calculate") diff --git a/src/main/resources/application-local.properties b/src/main/resources/application-local.properties index 6ee2eecb..06806e86 100644 --- a/src/main/resources/application-local.properties +++ b/src/main/resources/application-local.properties @@ -25,4 +25,4 @@ payment.amount.threshold=0 pspPoste.id=BPPIITRRZZZ # AMEX (American Express) payment ABI -pspAmex.abi=36019 +pspAmex.abi=AMREX diff --git a/src/test/java/it/gov/pagopa/afm/calculator/TestUtil.java b/src/test/java/it/gov/pagopa/afm/calculator/TestUtil.java index 6ceb4c85..11bfcc23 100644 --- a/src/test/java/it/gov/pagopa/afm/calculator/TestUtil.java +++ b/src/test/java/it/gov/pagopa/afm/calculator/TestUtil.java @@ -108,7 +108,7 @@ public static ValidBundle getMockAmexValidBundle() { .name("bundle1") .idPsp("AMEX") .pspBusinessName("psp business name amex") - .abi("36019") + .abi("AMREX") .paymentAmount(1L) .minPaymentAmount(0L) .maxPaymentAmount(1000L) diff --git a/src/test/java/it/gov/pagopa/afm/calculator/service/CalculatorServiceTest.java b/src/test/java/it/gov/pagopa/afm/calculator/service/CalculatorServiceTest.java index bbdb9d85..b3d124f2 100644 --- a/src/test/java/it/gov/pagopa/afm/calculator/service/CalculatorServiceTest.java +++ b/src/test/java/it/gov/pagopa/afm/calculator/service/CalculatorServiceTest.java @@ -122,7 +122,7 @@ void setup() throws StorageException { e.setProductType("3"); e.setProductCategory("C"); e.setIssuerId("999999"); - e.setAbi("36019"); + e.setAbi("AMREX"); Initializer.table.execute(TableOperation.insert(e)); } diff --git a/src/test/resources/responses/getAmexFees.json b/src/test/resources/responses/getAmexFees.json index 6e1321f3..5227a0d0 100644 --- a/src/test/resources/responses/getAmexFees.json +++ b/src/test/resources/responses/getAmexFees.json @@ -14,7 +14,7 @@ "idChannel": "AMEX_ONUS", "idBrokerPsp": null, "onUs": true, - "abi": "36019", + "abi": "AMREX", "pspBusinessName": "psp business name amex" } ]