diff options
Diffstat (limited to 'asdc-controller/src/test')
6 files changed, 25 insertions, 58 deletions
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCConfigurationTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCConfigurationTest.java index e4749742ee..c0e7d314e4 100644 --- a/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCConfigurationTest.java +++ b/asdc-controller/src/test/java/org/onap/so/asdc/client/ASDCConfigurationTest.java @@ -20,8 +20,7 @@ package org.onap.so.asdc.client; - - +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import javax.transaction.Transactional; import org.junit.Test; @@ -40,19 +39,18 @@ public class ASDCConfigurationTest extends BaseTest { @Test @Transactional - public void testInitASDCConfiguration() throws Exception { - assertTrue("msopreist".equals(config.getUser())); - assertTrue("msoasdc-id-local".equals(config.getConsumerGroup())); - assertTrue("msoasdc-id-local".equals(config.getConsumerID())); - assertTrue("Pre-IST".equals(config.getEnvironmentName())); - assertTrue("localhost:8443".equals(config.getAsdcAddress())); - assertTrue("msopreist".equals(config.getPassword())); - assertTrue(config.getPollingInterval() == 30); - assertTrue(config.getPollingTimeout() == 30); - assertTrue(config.getRelevantArtifactTypes().size() == config.SUPPORTED_ARTIFACT_TYPES_LIST.size()); - assertTrue(config.getWatchDogTimeout() == 1); - assertTrue(config.isUseHttpsWithDmaap() == true); - assertTrue(config.isUseHttpsWithSDC() == true); + public void testInitASDCConfiguration() { + assertEquals("msopreist", config.getUser()); + assertEquals("msoasdc-id-local", config.getConsumerGroup()); + assertEquals("msoasdc-id-local", config.getConsumerID()); + assertEquals("Pre-IST", config.getEnvironmentName()); + assertEquals("localhost:8443", config.getSdcAddress()); + assertEquals("msopreist", config.getPassword()); + assertEquals(30, config.getPollingInterval()); + assertEquals(30, config.getPollingTimeout()); + assertEquals(config.getRelevantArtifactTypes().size(), ASDCConfiguration.SUPPORTED_ARTIFACT_TYPES_LIST.size()); + assertEquals(1, config.getWatchDogTimeout()); + assertTrue(config.isUseHttpsWithSDC()); } } diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/client/tests/ASDCConfigurationTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/client/tests/ASDCConfigurationTest.java index 992d495369..5b8637d1ed 100644 --- a/asdc-controller/src/test/java/org/onap/so/asdc/client/tests/ASDCConfigurationTest.java +++ b/asdc-controller/src/test/java/org/onap/so/asdc/client/tests/ASDCConfigurationTest.java @@ -43,7 +43,7 @@ public class ASDCConfigurationTest extends BaseTest { @Autowired private ASDCConfiguration config; - private List<String> msgBusAddressList = new ArrayList<String>(); + private final List<String> msgBusAddressList = new ArrayList<>(); private static final String MSO_PRE_IST = "msopreist"; private static final String MSO_ASDC_ID_LOCAL = "msoasdc-id-local"; @@ -51,63 +51,58 @@ public class ASDCConfigurationTest extends BaseTest { private static final String ASDC_ADDRESS = "localhost:8443"; @Test - public void isUseHttpsWithDmaapTest() { - assertTrue(config.isUseHttpsWithDmaap()); - } - - @Test public void isConsumeProduceStatusTopicTest() { assertTrue(config.isConsumeProduceStatusTopic()); } @Test public void getUserTest() { - assertTrue(MSO_PRE_IST.equals(config.getUser())); + assertEquals(MSO_PRE_IST, config.getUser()); } @Test public void getConsumerGroupTest() { - assertTrue(MSO_ASDC_ID_LOCAL.equals(config.getConsumerGroup())); + assertEquals(MSO_ASDC_ID_LOCAL, config.getConsumerGroup()); } @Test public void getConsumerIDTest() { - assertTrue(MSO_ASDC_ID_LOCAL.equals(config.getConsumerID())); + assertEquals(MSO_ASDC_ID_LOCAL, config.getConsumerID()); } @Test public void getEnvironmentNameTest() { - assertTrue(PRE_IST.equals(config.getEnvironmentName())); + assertEquals(PRE_IST, config.getEnvironmentName()); } @Test public void getAsdcAddress() { - assertTrue(ASDC_ADDRESS.equals(config.getAsdcAddress())); + assertEquals(ASDC_ADDRESS, config.getSdcAddress()); } @Test public void getPasswordTest() { - assertTrue(MSO_PRE_IST.equals(config.getPassword())); + assertEquals(MSO_PRE_IST, config.getPassword()); } @Test public void getPollingIntervalTest() { - assertTrue(config.getPollingInterval() == 30); + assertEquals(30, config.getPollingInterval()); } @Test public void getPollingTimeoutTest() { - assertTrue(config.getPollingTimeout() == 30); + assertEquals(30, config.getPollingTimeout()); } @Test public void getRelevantArtifactTypesTest() { - assertTrue(config.getRelevantArtifactTypes().size() == ASDCConfiguration.SUPPORTED_ARTIFACT_TYPES_LIST.size()); + assertEquals(config.getRelevantArtifactTypes().size(), ASDCConfiguration.SUPPORTED_ARTIFACT_TYPES_LIST.size()); } @Test public void getWatchDogTimeoutTest() { - assertTrue(config.getWatchDogTimeout() == 1); + assertEquals(1, config.getWatchDogTimeout()); } @Test @@ -137,13 +132,4 @@ public class ASDCConfigurationTest extends BaseTest { String actualAsdcControllerName = config.getAsdcControllerName(); assertEquals(asdcControllerName, actualAsdcControllerName); } - - @Test - public void getMsgBusAddressTest() { - msgBusAddressList.add("localhost"); - msgBusAddressList.add("localhost"); - - List<String> actualMsgBusAddress = config.getMsgBusAddress(); - assertEquals(msgBusAddressList, actualMsgBusAddress); - } } diff --git a/asdc-controller/src/test/resources/application-test.yaml b/asdc-controller/src/test/resources/application-test.yaml index 31ec987152..e1fbe1ccd5 100644 --- a/asdc-controller/src/test/resources/application-test.yaml +++ b/asdc-controller/src/test/resources/application-test.yaml @@ -76,18 +76,16 @@ mso: consumerGroup: msoasdc-id-local consumerId: msoasdc-id-local environmentName: Pre-IST - asdcAddress: localhost:8443 + sdcAddress: localhost:8443 password: CB655C3C236F1F0370A347E3A0E0E133BE10ADCF4D16377E7378D3FE46A4BF60C27DF1FFB4 pollingInterval: 30 pollingTimeout: 30 relevantArtifactTypes: HEAT,HEAT_ENV,HEAT_VOL - useHttpsWithDmaap: true activateServerTLSAuth: false keyStorePassword: keyStorePath: watchDogTimeout: 1 isFilterInEmptyResources: true - messageBusAddress: localhost,localhost asdc: config: activity: diff --git a/asdc-controller/src/test/resources/mso-with-NULL.json b/asdc-controller/src/test/resources/mso-with-NULL.json index aeb740f31c..8e6454fae1 100644 --- a/asdc-controller/src/test/resources/mso-with-NULL.json +++ b/asdc-controller/src/test/resources/mso-with-NULL.json @@ -8,11 +8,6 @@ "asdcAddress": "hostname", "password": "1c551b8b5ab91fcd5a0907b11c304199", "watchDogTimeout": "300", - "messageBusAddress": [ - "localhost", - "localhost", - "localhost" - ], "pollingInterval":10, "pollingTimeout":30 diff --git a/asdc-controller/src/test/resources/mso.json b/asdc-controller/src/test/resources/mso.json index 6d3f7a3233..d80955f647 100644 --- a/asdc-controller/src/test/resources/mso.json +++ b/asdc-controller/src/test/resources/mso.json @@ -8,11 +8,6 @@ "asdcAddress": "hostname", "password": "1c551b8b5ab91fcd5a0907b11c304199", "watchDogTimeout": "300", - "messageBusAddress": [ - "localhost", - "localhost", - "localhost" - ], "pollingInterval":10, "pollingTimeout":30 diff --git a/asdc-controller/src/test/resources/mso4-with-TLS.json b/asdc-controller/src/test/resources/mso4-with-TLS.json index e1b32b7d4a..8c14117c41 100644 --- a/asdc-controller/src/test/resources/mso4-with-TLS.json +++ b/asdc-controller/src/test/resources/mso4-with-TLS.json @@ -11,11 +11,6 @@ "pollingTimeout":30, "activateServerTLSAuth": true, "watchDogTimeout": "300", - "messageBusAddress": [ - "localhost", - "localhost", - "localhost" - ], "keyStorePassword":"1c551b8b5ab91fcd5a0907b11c304199", "keyStorePath": "/test" } |