New parameter Sdc controller
[clamp.git] / src / test / java / org / onap / clamp / clds / config / sdc / SdcSingleControllerConfigurationTest.java
index ecef30e..dd60d27 100644 (file)
@@ -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",