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 final List<String> msgBusAddressList = new ArrayList<>();
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 isConsumeProduceStatusTopicTest() {
55 assertTrue(config.isConsumeProduceStatusTopic());
59 public void getUserTest() {
60 assertEquals(MSO_PRE_IST, config.getUser());
64 public void getConsumerGroupTest() {
65 assertEquals(MSO_ASDC_ID_LOCAL, config.getConsumerGroup());
69 public void getConsumerIDTest() {
70 assertEquals(MSO_ASDC_ID_LOCAL, config.getConsumerID());
74 public void getEnvironmentNameTest() {
75 assertEquals(PRE_IST, config.getEnvironmentName());
79 public void getAsdcAddress() {
80 assertEquals(ASDC_ADDRESS, config.getSdcAddress());
84 public void getPasswordTest() {
85 assertEquals(MSO_PRE_IST, config.getPassword());
89 public void getPollingIntervalTest() {
90 assertEquals(30, config.getPollingInterval());
94 public void getPollingTimeoutTest() {
95 assertEquals(30, config.getPollingTimeout());
99 public void getRelevantArtifactTypesTest() {
100 assertEquals(config.getRelevantArtifactTypes().size(), ASDCConfiguration.SUPPORTED_ARTIFACT_TYPES_LIST.size());
104 public void getWatchDogTimeoutTest() {
105 assertEquals(1, config.getWatchDogTimeout());
109 public void activateServerTLSAuthTest() {
110 assertFalse(config.activateServerTLSAuth());
114 public void getKeyStorePasswordTest() {
115 assertNull(config.getKeyStorePassword());
119 public void getKeyStorePathTest() {
120 assertNull(config.getKeyStorePath());
124 public void isFilterInEmptyResourcesTest() {
125 assertTrue(config.isFilterInEmptyResources());
129 public void setGetAsdcControllerNameTest() {
130 String asdcControllerName = "testAsdcControllerName";
131 config.setAsdcControllerName(asdcControllerName);
132 String actualAsdcControllerName = config.getAsdcControllerName();
133 assertEquals(asdcControllerName, actualAsdcControllerName);