From cdeb9b409e1c8f6456fb8d350b7497fbb314c0a6 Mon Sep 17 00:00:00 2001 From: giomella Date: Tue, 12 Sep 2023 16:04:28 +0200 Subject: [PATCH] [PRDP-133] changed service name and removed useless env. Fixed unit tests --- helm/values-dev.yaml | 1 - helm/values-prod.yaml | 1 - helm/values-uat.yaml | 1 - src/main/java/it/gov/pagopa/receipt/pdf/generator/Info.java | 2 +- src/main/resources-filtered/application.properties | 2 +- src/main/resources/logback.xml | 2 +- src/test/java/it/gov/pagopa/receipt/pdf/generator/InfoTest.java | 2 +- .../receipt-pdf-datastore/pom.properties | 2 +- 8 files changed, 5 insertions(+), 8 deletions(-) diff --git a/helm/values-dev.yaml b/helm/values-dev.yaml index f3aa28a5..eb29ed60 100644 --- a/helm/values-dev.yaml +++ b/helm/values-dev.yaml @@ -94,7 +94,6 @@ microservice-chart: CONSOLE_LOG_THRESHOLD: "DEBUG" CONSOLE_LOG_PATTERN: "%d{HH:mm:ss.SSS}[%thread]%-5level%logger{36}-%msg%n" CONSOLE_LOG_CHARSET: "UTF-8" - ECS_SERVICE_NAME: "pagopareceiptpdfgeneratorotl" OTEL_RESOURCE_ATTRIBUTES: "service.name=pagopareceiptpdfgeneratorotl,deployment.environment=dev" OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317" OTEL_LOGS_EXPORTER: none diff --git a/helm/values-prod.yaml b/helm/values-prod.yaml index d6fc0f0f..b974c98a 100644 --- a/helm/values-prod.yaml +++ b/helm/values-prod.yaml @@ -93,7 +93,6 @@ microservice-chart: CONSOLE_LOG_THRESHOLD: "DEBUG" CONSOLE_LOG_PATTERN: "%d{HH:mm:ss.SSS}[%thread]%-5level%logger{36}-%msg%n" CONSOLE_LOG_CHARSET: "UTF-8" - ECS_SERVICE_NAME: "pagopareceiptpdfgeneratorotl" OTEL_RESOURCE_ATTRIBUTES: "service.name=pagopareceiptpdfgeneratorotl,deployment.environment=prod" OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317" OTEL_LOGS_EXPORTER: none diff --git a/helm/values-uat.yaml b/helm/values-uat.yaml index 8e07cafc..0792941a 100644 --- a/helm/values-uat.yaml +++ b/helm/values-uat.yaml @@ -94,7 +94,6 @@ microservice-chart: CONSOLE_LOG_THRESHOLD: "DEBUG" CONSOLE_LOG_PATTERN: "%d{HH:mm:ss.SSS}[%thread]%-5level%logger{36}-%msg%n" CONSOLE_LOG_CHARSET: "UTF-8" - ECS_SERVICE_NAME: "pagopareceiptpdfgeneratorotl" OTEL_RESOURCE_ATTRIBUTES: "service.name=pagopareceiptpdfgeneratorotl,deployment.environment=uat" OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317" OTEL_LOGS_EXPORTER: none diff --git a/src/main/java/it/gov/pagopa/receipt/pdf/generator/Info.java b/src/main/java/it/gov/pagopa/receipt/pdf/generator/Info.java index 7f4724a3..094b94a2 100644 --- a/src/main/java/it/gov/pagopa/receipt/pdf/generator/Info.java +++ b/src/main/java/it/gov/pagopa/receipt/pdf/generator/Info.java @@ -49,7 +49,7 @@ public synchronized AppInfo getInfo() { if (inputStream != null) { properties.load(inputStream); version = properties.getProperty("version", null); - name = properties.getProperty("artifactId", null); + name = properties.getProperty("name", null); } } catch (Exception e) { logger.error("Impossible to retrieve information from pom.properties file.", e); diff --git a/src/main/resources-filtered/application.properties b/src/main/resources-filtered/application.properties index a2273e23..8a22575f 100644 --- a/src/main/resources-filtered/application.properties +++ b/src/main/resources-filtered/application.properties @@ -1,2 +1,2 @@ version=${project.version} -artifactId=${project.artifactId} \ No newline at end of file +name=${project.name} \ No newline at end of file diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index a3a63948..15583719 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -16,7 +16,7 @@ - ${ECS_SERVICE_NAME} + ${name} ${version} ${ENV} diff --git a/src/test/java/it/gov/pagopa/receipt/pdf/generator/InfoTest.java b/src/test/java/it/gov/pagopa/receipt/pdf/generator/InfoTest.java index 5f458936..d5434005 100644 --- a/src/test/java/it/gov/pagopa/receipt/pdf/generator/InfoTest.java +++ b/src/test/java/it/gov/pagopa/receipt/pdf/generator/InfoTest.java @@ -51,7 +51,7 @@ void runOK() { assertNotNull(responseBody.getName()); assertNotNull(responseBody.getVersion()); assertNotNull(responseBody.getEnvironment()); - assertEquals("receipt-pdf-generator", responseBody.getName()); + assertEquals("pagopa-receipt-pdf-generator", responseBody.getName()); assertEquals("azure-fn", responseBody.getEnvironment()); } } diff --git a/src/test/resources/META-INF/maven/it.gov.pagopa.receipt.pdf.datastore/receipt-pdf-datastore/pom.properties b/src/test/resources/META-INF/maven/it.gov.pagopa.receipt.pdf.datastore/receipt-pdf-datastore/pom.properties index ba47a396..884bea0a 100644 --- a/src/test/resources/META-INF/maven/it.gov.pagopa.receipt.pdf.datastore/receipt-pdf-datastore/pom.properties +++ b/src/test/resources/META-INF/maven/it.gov.pagopa.receipt.pdf.datastore/receipt-pdf-datastore/pom.properties @@ -1,5 +1,5 @@ #Generated by Maven #Mon Jul 31 17:21:09 CEST 2023 groupId=it.gov.pagopa.receipt -artifactId=receipt-pdf-generator +name=pagopa-receipt-pdf-generator version=x.y.z \ No newline at end of file