2 * Copyright © 2019 Bell Canada
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.onap.ccsdk.cds.sdclistener;
19 import org.junit.Test;
20 import org.junit.runner.RunWith;
21 import org.springframework.beans.factory.annotation.Autowired;
22 import org.springframework.boot.context.properties.EnableConfigurationProperties;
23 import org.springframework.boot.test.context.SpringBootTest;
24 import org.springframework.test.context.junit4.SpringRunner;
26 import static org.junit.Assert.assertEquals;
28 @RunWith(SpringRunner.class)
29 @EnableConfigurationProperties(SdcListenerConfiguration.class)
30 @SpringBootTest(classes = {SdcListenerConfigurationTest.class})
31 public class SdcListenerConfigurationTest {
34 private SdcListenerConfiguration listenerConfiguration;
37 public void testCdsSdcListenerConfiguration() {
38 assertEquals(listenerConfiguration.getAsdcAddress(), "localhost:8443");
39 assertEquals(listenerConfiguration.getMsgBusAddress().stream().findFirst().get(), "localhost");
40 assertEquals(listenerConfiguration.getUser(), "cds");
41 assertEquals(listenerConfiguration.getPassword(), "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U");
42 assertEquals(listenerConfiguration.getPollingInterval(), 15);
43 assertEquals(listenerConfiguration.getPollingTimeout(), 60);
44 assertEquals(listenerConfiguration.getRelevantArtifactTypes().stream().findFirst().get(), "TOSCA_CSAR");
45 assertEquals(listenerConfiguration.getConsumerGroup(), "cds-id-local");
46 assertEquals(listenerConfiguration.getEnvironmentName(), "AUTO");
47 assertEquals(listenerConfiguration.getConsumerID(), "cds-id-local");
48 assertEquals(listenerConfiguration.activateServerTLSAuth(), false);