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;
28 import java.util.ArrayList;
29 import java.util.List;
31 import javax.transaction.Transactional;
33 import org.junit.Test;
34 import org.onap.so.asdc.BaseTest;
35 import org.onap.so.asdc.client.ASDCConfiguration;
36 import org.springframework.beans.factory.annotation.Autowired;
39 * This class tests the ASDC Controller by using the ASDC Mock CLient
44 public class ASDCConfigurationTest extends BaseTest {
47 private ASDCConfiguration config;
49 private List<String> msgBusAddressList = new ArrayList<String>();
51 private static final String MSO_PRE_IST = "msopreist";
52 private static final String MSO_ASDC_ID_LOCAL = "msoasdc-id-local";
53 private static final String PRE_IST = "Pre-IST";
54 private static final String ASDC_ADDRESS = "localhost:8443";
57 public void isUseHttpsWithDmaapTest() {
58 assertFalse(config.isUseHttpsWithDmaap());
62 public void isConsumeProduceStatusTopicTest() {
63 assertTrue(config.isConsumeProduceStatusTopic());
67 public void getUserTest() {
68 assertTrue(MSO_PRE_IST.equals(config.getUser()));
72 public void getConsumerGroupTest() {
73 assertTrue(MSO_ASDC_ID_LOCAL.equals(config.getConsumerGroup()));
77 public void getConsumerIDTest() {
78 assertTrue(MSO_ASDC_ID_LOCAL.equals(config.getConsumerID()));
82 public void getEnvironmentNameTest() {
83 assertTrue(PRE_IST.equals(config.getEnvironmentName()));
87 public void getAsdcAddress() {
88 assertTrue(ASDC_ADDRESS.equals(config.getAsdcAddress()));
92 public void getPasswordTest() {
93 assertTrue(MSO_PRE_IST.equals(config.getPassword()));
97 public void getPollingIntervalTest() {
98 assertTrue(config.getPollingInterval() == 30);
102 public void getPollingTimeoutTest() {
103 assertTrue(config.getPollingTimeout() == 30);
107 public void getRelevantArtifactTypesTest() {
108 assertTrue(config.getRelevantArtifactTypes().size() == ASDCConfiguration.SUPPORTED_ARTIFACT_TYPES_LIST.size());
112 public void getWatchDogTimeoutTest() {
113 assertTrue(config.getWatchDogTimeout() == 1);
117 public void activateServerTLSAuthTest() {
118 assertFalse(config.activateServerTLSAuth());
122 public void getKeyStorePasswordTest() {
123 assertNull(config.getKeyStorePassword());
127 public void getKeyStorePathTest() {
128 assertNull(config.getKeyStorePath());
132 public void isFilterInEmptyResourcesTest() {
133 assertTrue(config.isFilterInEmptyResources());
137 public void setGetAsdcControllerNameTest() {
138 String asdcControllerName = "testAsdcControllerName";
139 config.setAsdcControllerName(asdcControllerName);
140 String actualAsdcControllerName = config.getAsdcControllerName();
141 assertEquals(asdcControllerName, actualAsdcControllerName);
145 public void getMsgBusAddressTest() {
146 msgBusAddressList.add("localhost");
147 msgBusAddressList.add("localhost");
149 List<String> actualMsgBusAddress = config.getMsgBusAddress();
150 assertEquals(msgBusAddressList, actualMsgBusAddress);