From 82402f3f3cdd68963360efabd1ea15b42cf0c97d Mon Sep 17 00:00:00 2001 From: Luca Consalvi Date: Wed, 27 Nov 2024 12:03:29 +0100 Subject: [PATCH] solve some sonar issues --- .../gov/pagopa/rtp/activator/RtpActivatorApplication.java | 3 +-- .../pagopa/rtp/activator/configuration/CosmosDBConfig.java | 5 ++++- .../pagopa/rtp/activator/RtpActivatorApplicationTest.java | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/it/gov/pagopa/rtp/activator/RtpActivatorApplication.java b/src/main/java/it/gov/pagopa/rtp/activator/RtpActivatorApplication.java index 0401379..15de606 100644 --- a/src/main/java/it/gov/pagopa/rtp/activator/RtpActivatorApplication.java +++ b/src/main/java/it/gov/pagopa/rtp/activator/RtpActivatorApplication.java @@ -4,7 +4,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.ConfigurationPropertiesScan; - import reactor.core.publisher.Hooks; @SpringBootApplication @@ -16,4 +15,4 @@ public static void main(String[] args) { SpringApplication.run(RtpActivatorApplication.class, args); } -} +} \ No newline at end of file diff --git a/src/main/java/it/gov/pagopa/rtp/activator/configuration/CosmosDBConfig.java b/src/main/java/it/gov/pagopa/rtp/activator/configuration/CosmosDBConfig.java index 3dc1b15..bf69f2a 100644 --- a/src/main/java/it/gov/pagopa/rtp/activator/configuration/CosmosDBConfig.java +++ b/src/main/java/it/gov/pagopa/rtp/activator/configuration/CosmosDBConfig.java @@ -16,9 +16,12 @@ @EnableReactiveCosmosRepositories("it.gov.pagopa.rtp.activator.repository") public class CosmosDBConfig extends AbstractCosmosConfiguration { - @Autowired private CosmosPropertiesConfig cosmosPropertiesConfig; + public CosmosDBConfig(CosmosPropertiesConfig cosmosPropertiesConfig){ + this.cosmosPropertiesConfig = cosmosPropertiesConfig; + } + @Override protected String getDatabaseName() { return cosmosPropertiesConfig.getDbName(); diff --git a/src/test/java/it/gov/pagopa/rtp/activator/RtpActivatorApplicationTest.java b/src/test/java/it/gov/pagopa/rtp/activator/RtpActivatorApplicationTest.java index e248a68..b363f5e 100644 --- a/src/test/java/it/gov/pagopa/rtp/activator/RtpActivatorApplicationTest.java +++ b/src/test/java/it/gov/pagopa/rtp/activator/RtpActivatorApplicationTest.java @@ -1,5 +1,7 @@ package it.gov.pagopa.rtp.activator; +import static org.junit.jupiter.api.Assertions.assertNotNull; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.test.context.junit.jupiter.SpringExtension; @@ -9,7 +11,7 @@ class RtpActivatorApplicationTests { @Test void contextLoads() { - //To expand - } + assertNotNull(new RtpActivatorApplication()); + } } \ No newline at end of file