Skip to content

Commit

Permalink
feat: [PAGOPA-1299] update amex abi (#112)
Browse files Browse the repository at this point in the history
* [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 <github-bot@pagopa.it>
Co-authored-by: aacitelli <aacitelli@host.docker.internal>
Co-authored-by: Jacopo <jacopo.carlini@gmail.com>
  • Loading branch information
4 people authored Oct 27, 2023
1 parent ff37572 commit b43a524
Show file tree
Hide file tree
Showing 17 changed files with 36 additions and 30 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/check_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/update_code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 ]
Expand Down
2 changes: 1 addition & 1 deletion helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion integration-test/src/config/.env.dev
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
AFM_HOST=https://api.dev.platform.pagopa.it/afm/calculator-service/v1
ID_PSP_POSTE=BPPIITRRZZZ
AMEX_ABI=36019
AMEX_ABI=AMREX
2 changes: 1 addition & 1 deletion integration-test/src/config/.env.local
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
AFM_HOST=http://localhost:8080
ID_PSP_POSTE=BPPIITRRZZZ
AMEX_ABI=36019
AMEX_ABI=AMREX
2 changes: 1 addition & 1 deletion integration-test/src/config/.env.uat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
AFM_HOST=https://api.uat.platform.pagopa.it/afm/calculator-service/v1
ID_PSP_POSTE=BPPIITRRXXX
AMEX_ABI=36019
AMEX_ABI=AMREX
2 changes: 1 addition & 1 deletion integration-test/src/config/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
"validityDateTo": null,
"touchpoint": "ANY",
"paymentType": "CP",
"abi": 36019,
"abi": "AMREX",
"pspBusinessName": "psp business name int-test-10"
}
],
Expand Down
8 changes: 4 additions & 4 deletions integration-test/src/features/getFeeByPsp.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -316,7 +316,7 @@ Feature: GetFeeByPsp
"idBrokerPsp": "88888888899",
"idChannel": "AMEX_ONUS",
"onUs": true,
"abi": "36019",
"abi": "AMREX",
"pspBusinessName": "psp business name int-test-10"
}
]
Expand Down
8 changes: 4 additions & 4 deletions integration-test/src/features/getFees.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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 |



Expand Down Expand Up @@ -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 |


Expand Down Expand Up @@ -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 |
Expand Down
2 changes: 1 addition & 1 deletion integration-test/src/step_definitions/support/steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ let isseuerEntity3 = {
PRODUCT_TYPE: "3",
PRODUCT_CATEGORY: "C",
ISSUER_ID: "999999",
ABI: "36019"
ABI: "AMREX"
};

// Synchronous
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class CalculatorService {

@Autowired IssuersService issuersService;

@Value("${pspAmex.abi:36019}")
@Value("${pspAmex.abi:AMREX}")
private String amexABI;

@Cacheable(value = "calculate")
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-local.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ payment.amount.threshold=0
pspPoste.id=BPPIITRRZZZ

# AMEX (American Express) payment ABI
pspAmex.abi=36019
pspAmex.abi=AMREX
2 changes: 1 addition & 1 deletion src/test/java/it/gov/pagopa/afm/calculator/TestUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/responses/getAmexFees.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"idChannel": "AMEX_ONUS",
"idBrokerPsp": null,
"onUs": true,
"abi": "36019",
"abi": "AMREX",
"pspBusinessName": "psp business name amex"
}
]
Expand Down

0 comments on commit b43a524

Please sign in to comment.