[SDC-DIST] Upgrade asdc-controller to use client version 2.0.0
[so.git] / asdc-controller / src / test / java / org / onap / so / asdc / client / tests / ASDCConfigurationTest.java
index db797cf..5b8637d 100644 (file)
@@ -24,12 +24,9 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
-
 import java.util.ArrayList;
 import java.util.List;
-
 import javax.transaction.Transactional;
-
 import org.junit.Test;
 import org.onap.so.asdc.BaseTest;
 import org.onap.so.asdc.client.ASDCConfiguration;
@@ -42,111 +39,97 @@ import org.springframework.beans.factory.annotation.Autowired;
  */
 @Transactional
 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";
     private static final String PRE_IST = "Pre-IST";
     private static final String ASDC_ADDRESS = "localhost:8443";
-    
-    @Test
-    public void isUseHttpsWithDmaapTest() {
-       assertTrue(config.isUseHttpsWithDmaap());
-    }
-    
+
     @Test
     public void isConsumeProduceStatusTopicTest() {
-       assertTrue(config.isConsumeProduceStatusTopic());
+        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
     public void activateServerTLSAuthTest() {
-       assertFalse(config.activateServerTLSAuth());
+        assertFalse(config.activateServerTLSAuth());
     }
-    
+
     @Test
     public void getKeyStorePasswordTest() {
-       assertNull(config.getKeyStorePassword());
+        assertNull(config.getKeyStorePassword());
     }
-    
+
     @Test
     public void getKeyStorePathTest() {
-       assertNull(config.getKeyStorePath());
+        assertNull(config.getKeyStorePath());
     }
-    
+
     @Test
     public void isFilterInEmptyResourcesTest() {
-       assertTrue(config.isFilterInEmptyResources());
+        assertTrue(config.isFilterInEmptyResources());
     }
-    
+
     @Test
     public void setGetAsdcControllerNameTest() {
-       String asdcControllerName = "testAsdcControllerName";
-       config.setAsdcControllerName(asdcControllerName);
-       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);
+        String asdcControllerName = "testAsdcControllerName";
+        config.setAsdcControllerName(asdcControllerName);
+        String actualAsdcControllerName = config.getAsdcControllerName();
+        assertEquals(asdcControllerName, actualAsdcControllerName);
     }
 }