2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.so.asdc.client.tests;
23 import static org.junit.Assert.assertEquals;
24 import static org.junit.Assert.assertFalse;
25 import static org.junit.Assert.assertNull;
26 import static org.junit.Assert.assertTrue;
27 import java.util.ArrayList;
28 import java.util.List;
29 import javax.transaction.Transactional;
30 import org.junit.Test;
31 import org.onap.so.asdc.BaseTest;
32 import org.onap.so.asdc.client.ASDCConfiguration;
33 import org.springframework.beans.factory.annotation.Autowired;
36 * This class tests the ASDC Controller by using the ASDC Mock CLient
41 public class ASDCConfigurationTest extends BaseTest {
44 private ASDCConfiguration config;
46 private List<String> msgBusAddressList = new ArrayList<String>();
48 private static final String MSO_PRE_IST = "msopreist";
49 private static final String MSO_ASDC_ID_LOCAL = "msoasdc-id-local";
50 private static final String PRE_IST = "Pre-IST";
51 private static final String ASDC_ADDRESS = "localhost:8443";
54 public void isUseHttpsWithDmaapTest() {
55 assertTrue(config.isUseHttpsWithDmaap());
59 public void isConsumeProduceStatusTopicTest() {
60 assertTrue(config.isConsumeProduceStatusTopic());
64 public void getUserTest() {
65 assertTrue(MSO_PRE_IST.equals(config.getUser()));
69 public void getConsumerGroupTest() {
70 assertTrue(MSO_ASDC_ID_LOCAL.equals(config.getConsumerGroup()));
74 public void getConsumerIDTest() {
75 assertTrue(MSO_ASDC_ID_LOCAL.equals(config.getConsumerID()));
79 public void getEnvironmentNameTest() {
80 assertTrue(PRE_IST.equals(config.getEnvironmentName()));
84 public void getAsdcAddress() {
85 assertTrue(ASDC_ADDRESS.equals(config.getAsdcAddress()));
89 public void getPasswordTest() {
90 assertTrue(MSO_PRE_IST.equals(config.getPassword()));
94 public void getPollingIntervalTest() {
95 assertTrue(config.getPollingInterval() == 30);
99 public void getPollingTimeoutTest() {
100 assertTrue(config.getPollingTimeout() == 30);
104 public void getRelevantArtifactTypesTest() {
105 assertTrue(config.getRelevantArtifactTypes().size() == ASDCConfiguration.SUPPORTED_ARTIFACT_TYPES_LIST.size());
109 public void getWatchDogTimeoutTest() {
110 assertTrue(config.getWatchDogTimeout() == 1);
114 public void activateServerTLSAuthTest() {
115 assertFalse(config.activateServerTLSAuth());
119 public void getKeyStorePasswordTest() {
120 assertNull(config.getKeyStorePassword());
124 public void getKeyStorePathTest() {
125 assertNull(config.getKeyStorePath());
129 public void isFilterInEmptyResourcesTest() {
130 assertTrue(config.isFilterInEmptyResources());
134 public void setGetAsdcControllerNameTest() {
135 String asdcControllerName = "testAsdcControllerName";
136 config.setAsdcControllerName(asdcControllerName);
137 String actualAsdcControllerName = config.getAsdcControllerName();
138 assertEquals(asdcControllerName, actualAsdcControllerName);
142 public void getMsgBusAddressTest() {
143 msgBusAddressList.add("localhost");
144 msgBusAddressList.add("localhost");
146 List<String> actualMsgBusAddress = config.getMsgBusAddress();
147 assertEquals(msgBusAddressList, actualMsgBusAddress);