diff options
7 files changed, 46 insertions, 46 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()); } } diff --git a/ms/sdclistener/distribution/src/main/dc/docker-compose.yaml b/ms/sdclistener/distribution/src/main/dc/docker-compose.yaml index b03953e72..65a25e2bb 100755 --- a/ms/sdclistener/distribution/src/main/dc/docker-compose.yaml +++ b/ms/sdclistener/distribution/src/main/dc/docker-compose.yaml @@ -6,8 +6,7 @@ services: container_name: cdssdclistener restart: always environment: - asdcAddress: localhost:8443 - messageBusAddress: localhost + sdcAddress: localhost:8443 sdcusername: vid password: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U pollingInterval: 15 diff --git a/ms/sdclistener/parent/pom.xml b/ms/sdclistener/parent/pom.xml index aa905e311..c498916df 100755 --- a/ms/sdclistener/parent/pom.xml +++ b/ms/sdclistener/parent/pom.xml @@ -40,7 +40,8 @@ <mockk.version>1.9</mockk.version> <dmaap.client.version>1.1.5</dmaap.client.version> <mockkserver.version>5.5.1</mockkserver.version> - <sdc-distribution-client.version>1.4.5</sdc-distribution-client.version> + <sdc-distribution-client.version>2.0.0</sdc-distribution-client.version> + <kafka.version>3.3.1</kafka.version> <jmockit.version>1.49</jmockit.version> <reactorcore.version>3.2.6.RELEASE</reactorcore.version> </properties> @@ -161,6 +162,11 @@ <artifactId>sdc-distribution-client</artifactId> <version>${sdc-distribution-client.version}</version> </dependency> + <dependency> + <groupId>org.apache.kafka</groupId> + <artifactId>kafka-clients</artifactId> + <version>${kafka.version}</version> + </dependency> </dependencies> </dependencyManagement> |