aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java13
-rw-r--r--src/test/resources/clds/sdc-controller-config-TLS.json5
-rw-r--r--src/test/resources/clds/sdc-controller-config-bad-address.json12
-rw-r--r--src/test/resources/clds/sdc-controllers-config.json11
4 files changed, 34 insertions, 7 deletions
diff --git a/src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java b/src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java
index ecef30ee..dd60d279 100644
--- a/src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java
+++ b/src/test/java/org/onap/clamp/clds/config/sdc/SdcSingleControllerConfigurationTest.java
@@ -20,6 +20,7 @@
package org.onap.clamp.clds.config.sdc;
+import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -65,6 +66,9 @@ public class SdcSingleControllerConfigurationTest {
sdcConfig.getRelevantArtifactTypes().size());
assertTrue(sdcConfig.activateServerTLSAuth());
assertEquals("ThePassword", sdcConfig.getKeyStorePassword());
+ assertArrayEquals(new String[] {
+ "localhost"
+ }, sdcConfig.getMsgBusAddress().toArray());
}
@Test(expected = SdcParametersException.class)
@@ -77,6 +81,15 @@ public class SdcSingleControllerConfigurationTest {
fail("Should have raised an exception");
}
+ @Test(expected = SdcParametersException.class)
+ public final void testAllRequiredParametersAddresses()
+ throws JsonParseException, JsonMappingException, IOException {
+ SdcSingleControllerConfiguration sdcConfig = loadControllerConfiguration(
+ "clds/sdc-controller-config-bad-address.json", "sdc-controller1");
+ sdcConfig.testAllRequiredParameters();
+ fail("Should have raised an exception");
+ }
+
@Test
public final void testConsumerGroupWithNull() throws JsonParseException, JsonMappingException, IOException {
SdcSingleControllerConfiguration sdcConfig = loadControllerConfiguration("clds/sdc-controller-config-NULL.json",
diff --git a/src/test/resources/clds/sdc-controller-config-TLS.json b/src/test/resources/clds/sdc-controller-config-TLS.json
index d7642e6b..066448ee 100644
--- a/src/test/resources/clds/sdc-controller-config-TLS.json
+++ b/src/test/resources/clds/sdc-controller-config-TLS.json
@@ -8,6 +8,7 @@
"pollingInterval":10,
"pollingTimeout":30,
"activateServerTLSAuth": true,
- "keyStorePassword":"bb3871669d893c7fb8aaacda31b77b4f537E67A081C2726889548ED7BC4C2DE6",
- "keyStorePath": "/test"
+ "keyStorePassword":"bb3871669d893c7fb8aaacda31b77b4f537E67A081C2726889548ED7BC4C2DE6",
+ "keyStorePath": "/test",
+ "messageBusAddresses":["localhost"]
}
diff --git a/src/test/resources/clds/sdc-controller-config-bad-address.json b/src/test/resources/clds/sdc-controller-config-bad-address.json
new file mode 100644
index 00000000..6775c6b3
--- /dev/null
+++ b/src/test/resources/clds/sdc-controller-config-bad-address.json
@@ -0,0 +1,12 @@
+{
+ "user": "User",
+ "consumerGroup": "consumerGroup",
+ "consumerId": "consumerId",
+ "environmentName": "environmentName",
+ "password": "bb3871669d893c7fb8aaacda31b77b4f537E67A081C2726889548ED7BC4C2DE6",
+ "pollingInterval":10,
+ "pollingTimeout":30,
+ "activateServerTLSAuth": true,
+ "keyStorePassword":"bb3871669d893c7fb8aaacda31b77b4f537E67A081C2726889548ED7BC4C2DE6",
+ "keyStorePath": "/test"
+}
diff --git a/src/test/resources/clds/sdc-controllers-config.json b/src/test/resources/clds/sdc-controllers-config.json
index df73a504..ce56fef2 100644
--- a/src/test/resources/clds/sdc-controllers-config.json
+++ b/src/test/resources/clds/sdc-controllers-config.json
@@ -5,21 +5,22 @@
"consumerGroup": "consumerGroup1",
"consumerId": "consumerId1",
"environmentName": "environmentName1",
- "sdcAddress": "hostname1",
+ "sdcAddress": "localhost:${docker.http-cache.port.host}",
"password": "bb3871669d893c7fb8aaacda31b77b4f537E67A081C2726889548ED7BC4C2DE6",
"pollingInterval":10,
- "pollingTimeout":30
-
+ "pollingTimeout":30,
+ "messageBusAddresses":["localhost"]
},
"sdc-controller2":{
"user": "User2",
"consumerGroup": "consumerGroup2",
"consumerId": "consumerId2",
"environmentName": "environmentName2",
- "sdcAddress": "hostname2",
+ "sdcAddress": "localhost:${docker.http-cache.port.host}",
"password": "bb3871669d893c7fb8aaacda31b77b4f537E67A081C2726889548ED7BC4C2DE6",
"pollingInterval":10,
- "pollingTimeout":30
+ "pollingTimeout":30,
+ "messageBusAddresses":["localhost"]
}
}