aboutsummaryrefslogtreecommitdiffstats
path: root/ms/cds-sdc-listener/application/src/test/java/org/onap/ccsdk/apps/cdssdclistener/CdsSdcListenerConfigurationTest.java
blob: 886049df7ff9f757cd5511cd5c6181393da90719 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * Copyright (C) 2019 Bell Canada. All rights reserved.
 *
 * NOTICE:  All the intellectual and technical concepts contained herein are
 * proprietary to Bell Canada and are protected by trade secret or copyright law.
 * Unauthorized copying of this file, via any medium is strictly prohibited.
 */

package org.onap.ccsdk.apps.cdssdclistener;

import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@EnableConfigurationProperties(CdsSdcListenerConfiguration.class)
@SpringBootTest(classes = {CdsSdcListenerConfigurationTest.class})
public class CdsSdcListenerConfigurationTest {

    @Autowired
    private CdsSdcListenerConfiguration listenerConfiguration;

    @Test
    public void testCdsSdcListenerConfiguration() {
        assertEquals(listenerConfiguration.getAsdcAddress(), "localhost:8443");
        assertEquals(listenerConfiguration.getMsgBusAddress().stream().findFirst().get(), "localhost");
        assertEquals(listenerConfiguration.getUser(), "vid");
        assertEquals(listenerConfiguration.getPassword(), "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U");
        assertEquals(listenerConfiguration.getPollingInterval(), 15);
        assertEquals(listenerConfiguration.getPollingTimeout(), 15);
        assertEquals(listenerConfiguration.getRelevantArtifactTypes().stream().findFirst().get(), "TOSCA_CSAR");
        assertEquals(listenerConfiguration.getConsumerGroup(), "cds-id-local");
        assertEquals(listenerConfiguration.getEnvironmentName(), "AUTO");
        assertEquals(listenerConfiguration.getConsumerID(), "cds-id-local");
        assertEquals(listenerConfiguration.activateServerTLSAuth(), false);
    }
}