diff options
author | 2022-09-22 15:53:19 +0100 | |
---|---|---|
committer | 2022-11-08 10:43:03 +0000 | |
commit | 96f21afcca1b60f70c98f4f2f997a40ca0f74e73 (patch) | |
tree | 0267950d8070191b7466bfe0a35a6e7bf925f1fa /ms/sdclistener/application | |
parent | f9533bb728b59ca8a270c427f6479a1e8fb244c0 (diff) |
[SDC-DIST] Upgrade sdc-distro-client to v 2.0.01.5.0
Signed-off-by: efiacor <fiachra.corcoran@est.tech>
Change-Id: I1443b94bc1b5524c35f8ccd464bcb5da767c925e
Issue-ID: DMAAP-1767
Diffstat (limited to 'ms/sdclistener/application')
5 files changed, 38 insertions, 43 deletions
diff --git a/ms/sdclistener/application/pom.xml b/ms/sdclistener/application/pom.xml index 88f426c1e..3ecab602f 100644 --- a/ms/sdclistener/application/pom.xml +++ b/ms/sdclistener/application/pom.xml @@ -68,6 +68,7 @@ <dependency> <groupId>org.onap.sdc.sdc-distribution-client</groupId> <artifactId>sdc-distribution-client</artifactId> + <version>${sdc-distribution-client.version}</version> </dependency> <dependency> <groupId>org.jmockit</groupId> @@ -123,5 +124,11 @@ <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> </dependency> + <dependency> + <groupId>com.github.stefanbirkner</groupId> + <artifactId>system-rules</artifactId> + <version>1.17.2</version> + <scope>test</scope> + </dependency> </dependencies> </project> diff --git a/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/SdcListenerConfiguration.java b/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/SdcListenerConfiguration.java index b56772afb..511dc08d5 100644 --- a/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/SdcListenerConfiguration.java +++ b/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/SdcListenerConfiguration.java @@ -31,11 +31,8 @@ public class SdcListenerConfiguration implements IConfiguration { public static final String TOSCA_CSAR = "TOSCA_CSAR"; - @Value("${listenerservice.config.asdcAddress}") - private String asdcAddress; - - @Value("${listenerservice.config.messageBusAddress}") - private List<String> messageBusAddress; + @Value("${listenerservice.config.sdcAddress}") + private String sdcAddress; @Value("${listenerservice.config.user}") private String user; @@ -64,9 +61,6 @@ public class SdcListenerConfiguration implements IConfiguration { @Value("${listenerservice.config.activateServerTLSAuth}") private boolean activateServerTLSAuth; - @Value("${listenerservice.config.isUseHttpsWithDmaap}") - private boolean isUseHttpsWithDmaap; - @Value("${listenerservice.config.isUseHttpsWithSDC}") private boolean isUseHttpsWithSDC; @@ -83,13 +77,8 @@ public class SdcListenerConfiguration implements IConfiguration { private int getHttpProxyPort; @Override - public String getAsdcAddress() { - return asdcAddress; - } - - @Override - public List<String> getMsgBusAddress() { - return messageBusAddress; + public String getSdcAddress() { + return sdcAddress; } @Override @@ -153,11 +142,6 @@ public class SdcListenerConfiguration implements IConfiguration { } @Override - public Boolean isUseHttpsWithDmaap() { - return isUseHttpsWithDmaap; - } - - @Override public Boolean isUseHttpsWithSDC() { return isUseHttpsWithSDC; } @@ -169,7 +153,7 @@ public class SdcListenerConfiguration implements IConfiguration { @Override public String getHttpProxyHost() { - return getHttpsProxyHost; + return getHttpProxyHost; } @Override @@ -179,9 +163,7 @@ public class SdcListenerConfiguration implements IConfiguration { @Override public int getHttpProxyPort() { - return getHttpsProxyPort; + return getHttpProxyPort; } - } - diff --git a/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/client/SdcListenerClient.java b/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/client/SdcListenerClient.java index 2d8c1fe04..3847350f7 100644 --- a/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/client/SdcListenerClient.java +++ b/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/client/SdcListenerClient.java @@ -64,7 +64,6 @@ public class SdcListenerClient { listenerDto.setManagedChannelForGrpc(); listenerDto.setDistributionClient(distributionClient); - IDistributionClientResult result = distributionClient.init(configuration, notification); startSdcClientBasedOnTheResult(result); } diff --git a/ms/sdclistener/application/src/main/resources/application.yaml b/ms/sdclistener/application/src/main/resources/application.yaml index 080f19d26..259f8c4c5 100644 --- a/ms/sdclistener/application/src/main/resources/application.yaml +++ b/ms/sdclistener/application/src/main/resources/application.yaml @@ -1,7 +1,6 @@ listenerservice: config: - asdcAddress: ${asdcAddress:localhost:8443} - messageBusAddress: ${messageBusAddress:localhost} + sdcAddress: ${sdcAddress:localhost:8443} user: ${sdcusername:cds} password: ${password:Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U} pollingInterval: ${pollingInterval:15} @@ -13,7 +12,6 @@ listenerservice: keyStorePassword: ${keyStorePassword} keyStorePath: ${keyStorePath} activateServerTLSAuth : ${activateServerTLSAuth:false} - isUseHttpsWithDmaap: ${isUseHttpsWithDmaap:false} isUseHttpsWithSDC: ${isUseHttpsWithSDC:true} archivePath: ${archivePath:/opt/app/onap/cds-sdc-listener/} grpcAddress: ${grpcAddress:localhost} diff --git a/ms/sdclistener/application/src/test/java/org/onap/ccsdk/cds/sdclistener/SdcListenerConfigurationTest.java b/ms/sdclistener/application/src/test/java/org/onap/ccsdk/cds/sdclistener/SdcListenerConfigurationTest.java index bc07c5207..57ad03c5b 100644 --- a/ms/sdclistener/application/src/test/java/org/onap/ccsdk/cds/sdclistener/SdcListenerConfigurationTest.java +++ b/ms/sdclistener/application/src/test/java/org/onap/ccsdk/cds/sdclistener/SdcListenerConfigurationTest.java @@ -16,38 +16,47 @@ package org.onap.ccsdk.cds.sdclistener; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; + +import org.junit.Rule; import org.junit.Test; +import org.junit.contrib.java.lang.system.EnvironmentVariables; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; -import static org.junit.Assert.assertEquals; - @RunWith(SpringRunner.class) @EnableConfigurationProperties(SdcListenerConfiguration.class) @SpringBootTest(classes = {SdcListenerConfigurationTest.class}) public class SdcListenerConfigurationTest { + @Rule + public EnvironmentVariables environmentVariables = new EnvironmentVariables(); + @Autowired private SdcListenerConfiguration listenerConfiguration; @Test public void testCdsSdcListenerConfiguration() { - assertEquals(listenerConfiguration.getAsdcAddress(), "localhost:8443"); - assertEquals(listenerConfiguration.getMsgBusAddress().stream().findFirst().get(), "localhost"); - assertEquals(listenerConfiguration.getUser(), "cds"); - assertEquals(listenerConfiguration.getPassword(), "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"); - assertEquals(listenerConfiguration.getPollingInterval(), 15); - assertEquals(listenerConfiguration.getPollingTimeout(), 60); - assertEquals(listenerConfiguration.getRelevantArtifactTypes().stream().findFirst().get(), "TOSCA_CSAR"); - assertEquals(listenerConfiguration.getConsumerGroup(), "cds-id-local"); - assertEquals(listenerConfiguration.getEnvironmentName(), "AUTO"); - assertEquals(listenerConfiguration.getConsumerID(), "cds-id-local"); - assertEquals(listenerConfiguration.activateServerTLSAuth(), false); - assertEquals(listenerConfiguration.isUseHttpsWithSDC(), true); - assertEquals(listenerConfiguration.isUseHttpsWithDmaap(), false); + environmentVariables.set("SASL_JAAS_CONFIG", + "org.apache.kafka.common.security.scram.ScramLoginModule required username=admin password=admin-secret;"); + assertEquals("localhost:8443", listenerConfiguration.getSdcAddress()); + assertEquals( + "org.apache.kafka.common.security.scram.ScramLoginModule required username=admin password=admin-secret;", + listenerConfiguration.getKafkaSaslJaasConfig()); + assertEquals("cds", listenerConfiguration.getUser()); + assertEquals("Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U", listenerConfiguration.getPassword()); + assertEquals(15, listenerConfiguration.getPollingInterval()); + assertEquals(60, listenerConfiguration.getPollingTimeout()); + assertEquals("TOSCA_CSAR", listenerConfiguration.getRelevantArtifactTypes().stream().findFirst().get()); + assertEquals("cds-id-local", listenerConfiguration.getConsumerGroup()); + assertEquals("AUTO", listenerConfiguration.getEnvironmentName()); + assertEquals("cds-id-local", listenerConfiguration.getConsumerID()); + assertFalse(listenerConfiguration.activateServerTLSAuth()); + assertEquals(true, listenerConfiguration.isUseHttpsWithSDC()); } } |