Skip to content

Commit

Permalink
Merge pull request #293 from pagopa/develop
Browse files Browse the repository at this point in the history
fix: Promotion to master
  • Loading branch information
and-mora authored Nov 9, 2022
2 parents f162f26 + 7c4e407 commit 6da0132
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 48 deletions.
4 changes: 2 additions & 2 deletions api/batch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<parent>
<artifactId>rtd-ms-transaction-filter-api</artifactId>
<groupId>it.gov.pagopa.rtd.ms.transaction_filter.api</groupId>
<version>1.3.0</version>
<version>1.3.2</version>
</parent>

<artifactId>rtd-ms-transaction-filter-api-batch</artifactId>
<version>1.3.0</version>
<version>1.3.2</version>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileExistsException;
import org.apache.commons.io.FileUtils;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.scope.context.ChunkContext;
Expand Down Expand Up @@ -70,7 +71,11 @@ private Optional<Path> getParentTemporaryDirectory(List<File> senderAdeAckFiles)
private void saveFilesToOutputDirectory(List<File> senderAdeAckFiles) throws IOException {
for (File sourceFile : senderAdeAckFiles) {
File outputFile = createOutputFile(sourceFile.getName());
FileUtils.moveFile(sourceFile, outputFile);
try {
FileUtils.moveFile(sourceFile, outputFile);
} catch(FileExistsException exception) {
log.debug("File {} already exists and will not be overwritten.", outputFile.getName());
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package it.gov.pagopa.rtd.transaction_filter.batch.step.tasklet;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.Mockito.verify;

Expand Down Expand Up @@ -169,6 +170,19 @@ void whenDirectoryIsNotSetThenThrowException() {
.isInstanceOf(IllegalArgumentException.class);
}

@SneakyThrows
@Test
void givenAFileAlreadySavedWhenGetAdeAckFilesThenDoNotThrowException() {
Files.createFile(temporaryOutputPath.resolve("senderAdeAck1.txt"));
BDDMockito.doReturn(Collections.singletonList(defaultResponse.get(0))).when(restClient)
.getSenderAdeAckFiles();

// assert that FileExistsException is not thrown
StepContribution stepContribution = new StepContribution(execution);
assertThatCode(() -> tasklet.execute(stepContribution, chunkContext))
.doesNotThrowAnyException();
}

SenderAdeAckFilesRecoveryTasklet createDefaultTasklet() {
SenderAdeAckFilesRecoveryTasklet tasklet = new SenderAdeAckFilesRecoveryTasklet(restClient);
tasklet.setSenderAdeAckDirectory(temporaryOutputPath.toString());
Expand Down
4 changes: 2 additions & 2 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<parent>
<artifactId>rtd-ms-transaction-filter</artifactId>
<groupId>it.gov.pagopa.rtd.ms</groupId>
<version>1.3.0</version>
<version>1.3.2</version>
</parent>

<groupId>it.gov.pagopa.rtd.ms.transaction_filter.api</groupId>
<artifactId>rtd-ms-transaction-filter-api</artifactId>
<version>1.3.0</version>
<version>1.3.2</version>

<packaging>pom</packaging>

Expand Down
4 changes: 2 additions & 2 deletions app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<parent>
<artifactId>rtd-ms-transaction-filter</artifactId>
<groupId>it.gov.pagopa.rtd.ms</groupId>
<version>1.3.0</version>
<version>1.3.2</version>
</parent>

<groupId>it.gov.pagopa.rtd.ms.transaction_filter</groupId>
<artifactId>transaction-filter-app</artifactId>
<version>1.3.0</version>
<version>1.3.2</version>

<dependencies>
<dependency>
Expand Down
16 changes: 8 additions & 8 deletions app/src/main/resources/config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ batchConfiguration:
rest-client:
user-agent:
prefix: BatchService
version: 1.3.0
version: 1.3.2
hpan:
serviceCode: hpan-service
base-url: ${HPAN_SERVICE_URL:https://bpd-dev.azure-api.net:${HPAN_SERVICE_PORT:443}}
Expand Down Expand Up @@ -139,13 +139,6 @@ rest-client:
url: /rtd/csv-transaction/publickey
abi-to-fiscalcode-map:
url: /rtd/abi-to-fiscalcode/conversion-map
sender-ade-ack:
list:
url: /rtd/file-register/sender-ade-ack
download-file:
url: /ade/{id}
received:
url: /rtd/file-register/ack-received/{id}
mtls:
enabled: ${HPAN_SERVICE_MTLS_ENABLED:true}
key-store:
Expand All @@ -161,6 +154,13 @@ rest-client:
header:
blobType: BlockBlob
version: "2021-08-06"
sender-ade-ack:
list:
url: /rtd/file-register/sender-ade-ack
download-file:
url: /ade/{id}
received:
url: /rtd/file-register/ack-received/{id}

feign:
client:
Expand Down
4 changes: 2 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<parent>
<artifactId>rtd-ms-transaction-filter</artifactId>
<groupId>it.gov.pagopa.rtd.ms</groupId>
<version>1.3.0</version>
<version>1.3.2</version>
</parent>

<groupId>it.gov.pagopa.rtd.ms.transaction_filter</groupId>
<artifactId>rtd-ms-transaction-filter-core</artifactId>
<version>1.3.0</version>
<version>1.3.2</version>

<dependencies>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions integration/jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<parent>
<artifactId>rtd-ms-transaction-filter-integration</artifactId>
<groupId>it.gov.pagopa.rtd.ms.transaction_filter</groupId>
<version>1.3.0</version>
<version>1.3.2</version>
</parent>

<groupId>it.gov.pagopa.rtd.ms.transaction_filter.integration</groupId>
<artifactId>rtd-ms-transaction-filter-integration-jpa</artifactId>
<version>1.3.0</version>
<version>1.3.2</version>

<dependencies>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<parent>
<artifactId>rtd-ms-transaction-filter</artifactId>
<groupId>it.gov.pagopa.rtd.ms</groupId>
<version>1.3.0</version>
<version>1.3.2</version>
</parent>

<groupId>it.gov.pagopa.rtd.ms.transaction_filter</groupId>
<artifactId>rtd-ms-transaction-filter-integration</artifactId>
<version>1.3.0</version>
<version>1.3.2</version>

<packaging>pom</packaging>

Expand Down
4 changes: 2 additions & 2 deletions integration/rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<parent>
<groupId>it.gov.pagopa.rtd.ms.transaction_filter</groupId>
<artifactId>rtd-ms-transaction-filter-integration</artifactId>
<version>1.3.0</version>
<version>1.3.2</version>
</parent>

<groupId>it.gov.pagopa.rtd.ms.transaction_filter.integration</groupId>
<artifactId>rtd-ms-transaction-filter-integration-rest</artifactId>
<version>1.3.0</version>
<version>1.3.2</version>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void whenLogContainsSaltThenAnonymizeIt(CapturedOutput output) {
String stringWithSalt =
"[HpanRestConnector#getSalt] ---> GET https://api.dev.cstar.pagopa.it/rtd/payment-instrument-manager/v2/salt HTTP/1.1\n"
+ "[HpanRestConnector#getSalt] Ocp-Apim-Subscription-Key: ciao\n"
+ "[HpanRestConnector#getSalt] User-Agent: BatchService/1.3.0\n"
+ "[HpanRestConnector#getSalt] User-Agent: BatchService/1.3.2\n"
+ "[HpanRestConnector#getSalt] ---> END HTTP (0-byte body)\n"
+ "[HpanRestConnector#getSalt] <--- HTTP/1.1 200 OK (57ms)\n"
+ "[HpanRestConnector#getSalt] connection: keep-alive\n"
Expand Down
16 changes: 8 additions & 8 deletions ops_resources/example_config/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ batchConfiguration:
rest-client:
user-agent:
prefix: BatchService
version: 1.3.0
version: 1.3.2
hpan:
serviceCode: hpan-service
base-url: ${HPAN_SERVICE_URL:https://bpd-dev.azure-api.net:${HPAN_SERVICE_PORT:443}}
Expand Down Expand Up @@ -138,13 +138,6 @@ rest-client:
url: /rtd/csv-transaction/publickey
abi-to-fiscalcode-map:
url: /rtd/abi-to-fiscalcode/conversion-map
sender-ade-ack:
list:
url: /rtd/file-register/sender-ade-ack
download-file:
url: /ade/{id}
received:
url: /rtd/file-register/ack-received/{id}
mtls:
enabled: ${HPAN_SERVICE_MTLS_ENABLED:true}
key-store:
Expand All @@ -160,6 +153,13 @@ rest-client:
header:
blobType: BlockBlob
version: "2021-08-06"
sender-ade-ack:
list:
url: /rtd/file-register/sender-ade-ack
download-file:
url: /ade/{id}
received:
url: /rtd/file-register/ack-received/{id}

feign:
client:
Expand Down
16 changes: 8 additions & 8 deletions ops_resources/example_config/application_hbsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ batchConfiguration:
rest-client:
user-agent:
prefix: BatchService
version: 1.3.0
version: 1.3.2
hpan:
serviceCode: hpan-service
base-url: ${HPAN_SERVICE_URL:https://bpd-dev.azure-api.net:${HPAN_SERVICE_PORT:443}}
Expand Down Expand Up @@ -116,13 +116,6 @@ rest-client:
url: /rtd/csv-transaction/publickey
abi-to-fiscalcode-map:
url: /rtd/abi-to-fiscalcode/conversion-map
sender-ade-ack:
list:
url: /rtd/file-register/sender-ade-ack
download-file:
url: /ade/{id}
received:
url: /rtd/file-register/ack-received/{id}
mtls:
enabled: ${HPAN_SERVICE_MTLS_ENABLED:true}
key-store:
Expand All @@ -138,6 +131,13 @@ rest-client:
header:
blobType: BlockBlob
version: "2021-08-06"
sender-ade-ack:
list:
url: /rtd/file-register/sender-ade-ack
download-file:
url: /ade/{id}
received:
url: /rtd/file-register/ack-received/{id}

feign:
client:
Expand Down
29 changes: 21 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@

<groupId>it.gov.pagopa.rtd.ms</groupId>
<artifactId>rtd-ms-transaction-filter</artifactId>
<version>1.3.0</version>
<version>1.3.2</version>

<packaging>pom</packaging>

<properties>
<java.version>1.8</java.version>
<spring-boot.version>2.7.4</spring-boot.version>
<postgresql.version>42.5.0</postgresql.version>
<springframework-cloud.version>3.1.4</springframework-cloud.version>
<snakeyaml.version>1.33</snakeyaml.version>
<common-io.version>2.11.0</common-io.version>
<bouncycastle.version>1.70</bouncycastle.version>
<jackson-core.version>2.14.0</jackson-core.version>
<maven-jar-plugin.version>3.1.2</maven-jar-plugin.version>
<maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
<maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
Expand All @@ -27,42 +33,49 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sonar.exclusions>**/enums/**,**/model/**,**/Constants*.java,**/*Config.java,**/*Application.java
</sonar.exclusions>
<transaction-filter.version>1.3.0</transaction-filter.version>
<transaction-filter.version>1.3.2</transaction-filter.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.5.0</version>
<version>${postgresql.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-wiremock</artifactId>
<version>3.1.4</version>
<version>${springframework-cloud.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<version>3.1.4</version>
<version>${springframework-cloud.version}</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.33</version>
<version>${snakeyaml.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
<version>${common-io.version}</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpg-jdk15on</artifactId>
<version>1.70</version>
<version>${bouncycastle.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-core.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>it.gov.pagopa.rtd.ms.transaction_filter.integration</groupId>
Expand Down

0 comments on commit 6da0132

Please sign in to comment.