Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [PagoPA-1607] - java 17 migration #94

Merged
merged 11 commits into from
Mar 22, 2024
Merged
3 changes: 2 additions & 1 deletion .github/workflows/code_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Code Review
uses: pagopa/github-actions-template/maven-code-review@v1.4.2
uses: pagopa/github-actions-template/maven-code-review@v1.10.4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
sonar_token: ${{ secrets.SONAR_TOKEN }}
project_key: ${{env.PROJECT_KEY}}
coverage_exclusions: "**/config/*,**/*Mock*,**/model/**,**/entity/*"
cpd_exclusions: "**/model/**,**/entity/*"
java_version: 17

smoke-test:
name: Smoke Test
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update_code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
run: hub pr checkout ${{ github.event.issue.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17

- name: Run Service on Docker
shell: bash
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#
# Build
#
FROM maven:3.8.4-jdk-11-slim as buildtime
FROM maven:3.9.3-amazoncorretto-17@sha256:4ab7db7bd5f95e58b0ba1346ff29d6abdd9b73e5fd89c5140edead8b037386ff AS buildtime
WORKDIR /build
COPY . .
RUN mvn clean package -Dmaven.test.skip=true

#
# Package stage
#
FROM --platform=linux/amd64 adoptopenjdk/openjdk16:alpine as builder
FROM --platform=linux/amd64 amazoncorretto:17.0.9-alpine3.18@sha256:df48bf2e183230040890460ddb4359a10aa6c7aad24bd88899482c52053c7e17 as builder
COPY --from=buildtime /build/target/*.jar application.jar
RUN java -Djarmode=layertools -jar application.jar extract


FROM ghcr.io/pagopa/docker-base-springboot-openjdk11:v1.0.1@sha256:bbbe948e91efa0a3e66d8f308047ec255f64898e7f9250bdb63985efd3a95dbf
FROM ghcr.io/pagopa/docker-base-springboot-openjdk17:v1.1.0@sha256:6fa320d452fa22066441f1ef292d15eb06f944bc8bca293e1a91ea460d30a613
COPY --chown=spring:spring --from=builder dependencies/ ./
COPY --chown=spring:spring --from=builder snapshot-dependencies/ ./
# https://github.com/moby/moby/issues/37965#issuecomment-426853382
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ See the [OpenApi 3 here.](https://editor.swagger.io/?url=https://raw.githubuserc

## Technology Stack 📚

- Java 11
- Java 17
- Spring Boot
- Spring Web
- Feign Client
Expand Down
4 changes: 2 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: pagopa-gpd-payments
description: Microservice that exposes API for payment receipts retrieving and other operations
type: application
version: 0.75.0
appVersion: 0.12.11
version: 0.76.0
appVersion: 0.12.12
dependencies:
- name: microservice-chart
version: 2.4.0
Expand Down
2 changes: 1 addition & 1 deletion helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-gpd-payments
tag: "0.12.11"
tag: "0.12.12"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-gpd-payments
tag: "0.12.11"
tag: "0.12.12"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-gpd-payments
tag: "0.12.11"
tag: "0.12.12"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
3 changes: 2 additions & 1 deletion integration-test/src/config/.env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ api_config_host=https://api.dev.platform.pagopa.it/apiconfig/auth/api/v1
gpd_host=https://api.dev.platform.pagopa.it/gpd/api/v1
nodo_host=https://api.dev.platform.pagopa.it/nodo

invalid_creditor_institution=00112233445
invalid_creditor_institution=00112233555
pspId=AGID_01
pspBrokerId=97735020584
pspChannelId=97735020584_03
pspName=AgID
pspFiscalCode=CFAGID_01
pspPassword=pwdpwdpwd
ip=api.dev.platform.pagopa.it
3 changes: 2 additions & 1 deletion integration-test/src/config/.env.local
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ api_config_host=https://api.dev.platform.pagopa.it/apiconfig/auth/api/v1
gpd_host=https://api.dev.platform.pagopa.it/gpd/api/v1
nodo_host=https://api.dev.platform.pagopa.it/nodo

invalid_creditor_institution=00112233445
invalid_creditor_institution=00112233555
pspId=AGID_01
pspBrokerId=97735020584
pspChannelId=97735020584_03
pspName=AgID
pspFiscalCode=CFAGID_01
pspPassword=pwdpwdpwd
ip=api.dev.platform.pagopa.it
5 changes: 3 additions & 2 deletions integration-test/src/config/.env.uat
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ api_config_host=https://api.uat.platform.pagopa.it/apiconfig/auth/api/v1
gpd_host=https://api.uat.platform.pagopa.it/gpd/api/v1
nodo_host=https://api.uat.platform.pagopa.it/nodo

invalid_creditor_institution=00112233445
invalid_creditor_institution=00112233555
pspId=AGID_02
pspBrokerId=97735020584
pspChannelId=97735020584_05
pspName=PSP_Agid
pspPassword=pwd_AgID
pspPassword=pwd_AgID
ip=api.uat.platform.pagopa.it
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Feature: All about Activate Phase on Debt Position Payments workflow
And ApiConfig running
And the creditor institution "77777777777"
And the creditor institution broker "15376371009"
And the station "15376371009_01"
And the station "15376371009_01" for the broker "15376371009"
And if necessary, refresh the configuration and wait 30 seconds
And a valid debt position
And a proper verification of debt position

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Feature: All about Activate Phase on Debt Position Payments workflow
And ApiConfig running
And the creditor institution "77777777777"
And the creditor institution broker "15376371009"
And the station "15376371009_01"
And the station "15376371009_01" for the broker "15376371009"
And if necessary, refresh the configuration and wait 30 seconds
And a valid debt position

@GPDScenario
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Feature: All about Send Receipt Phase on Debt Position Payments workflow
And ApiConfig running
And the creditor institution "77777777777"
And the creditor institution broker "15376371009"
And the station "15376371009_01"
And the station "15376371009_01" for the broker "15376371009"
And if necessary, refresh the configuration and wait 30 seconds
And a valid debt position
And a proper verification of debt position
And a proper activation of debt position
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Feature: All about Verify Phase on Debt Position Payments workflow
And ApiConfig running
And the creditor institution "77777777777"
And the creditor institution broker "15376371009"
And the station "15376371009_01"
And the station "15376371009_01" for the broker "15376371009"
And if necessary, refresh the configuration and wait 30 seconds
And a valid debt position

@GPDScenario
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,25 @@ function readCreditorInstitution(orgId) {
})
}

function createCreditorInstitution(body) {
return post(api_config_host + `/creditorinstitutions`, body, {
headers: {
"Ocp-Apim-Subscription-Key": process.env.SUBKEY
}
})
}


function readCreditorInstitutionIbans(orgId) {
return get(api_config_host + `/creditorinstitutions/${orgId}/ibans`, {
return get(api_config_host + `/creditorinstitutions/${orgId}/ibans/enhanced`, {
headers: {
"Ocp-Apim-Subscription-Key": process.env.SUBKEY
}
})
}

function createCreditorInstitutionIbans(orgId, body) {
return post(api_config_host + `/creditorinstitutions/${orgId}/ibans`, body, {
headers: {
"Ocp-Apim-Subscription-Key": process.env.SUBKEY
}
Expand All @@ -35,6 +52,14 @@ function readCreditorInstitutionBroker(brokerId) {
})
}

function createCreditorInstitutionBroker(body) {
return post(api_config_host + `/brokers`, body, {
headers: {
"Ocp-Apim-Subscription-Key": process.env.SUBKEY
}
})
}

function readStation(stationId) {
return get(api_config_host + `/stations/${stationId}`, {
headers: {
Expand All @@ -43,6 +68,14 @@ function readStation(stationId) {
})
}

function createStation(body) {
return post(api_config_host + `/stations`, body, {
headers: {
"Ocp-Apim-Subscription-Key": process.env.SUBKEY
}
})
}

function readECStationAssociation(stationId, orgId) {
return get(api_config_host + `/stations/${stationId}/creditorinstitutions/${orgId}`, {
headers: {
Expand All @@ -51,11 +84,33 @@ function readECStationAssociation(stationId, orgId) {
})
}

function createECStationAssociation(orgId, body) {
return post(api_config_host + `/creditorinstitutions/${orgId}/stations`, body, {
headers: {
"Ocp-Apim-Subscription-Key": process.env.SUBKEY
}
})
}

function refreshConfig() {
return get(api_config_host + `/refresh/config`, {
headers: {
"Ocp-Apim-Subscription-Key": process.env.SUBKEY
}
})
}

module.exports = {
apiConfigHealthCheck,
readCreditorInstitution,
readCreditorInstitutionBroker,
readCreditorInstitutionIbans,
readECStationAssociation,
readStation
readStation,
createCreditorInstitution,
createCreditorInstitutionIbans,
createCreditorInstitutionBroker,
createStation,
createECStationAssociation,
refreshConfig
}
Loading
Loading