7329f313a5b8493888fef55cced7cfdd209c4568
[so.git] / mso-api-handlers / mso-api-handler-infra / src / test / java / org / onap / so / apihandlerinfra / tenantisolation / dmaap / OperationalEnvironmentPublisherTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.onap.so.apihandlerinfra.tenantisolation.dmaap;
22
23 import static org.junit.Assert.assertEquals;
24
25 import java.io.FileNotFoundException;
26 import java.io.IOException;
27
28 import org.junit.Test;
29 import org.junit.runner.RunWith;
30 import org.onap.so.apihandlerinfra.ApiHandlerApplication;
31 import org.onap.so.apihandlerinfra.BaseTest;
32 import org.springframework.beans.factory.annotation.Autowired;
33 import org.springframework.boot.test.context.SpringBootTest;
34 import org.springframework.test.context.ActiveProfiles;
35 import org.springframework.test.context.junit4.SpringRunner;
36
37
38 public class OperationalEnvironmentPublisherTest extends BaseTest {
39
40         @Autowired
41         private OperationalEnvironmentPublisher publisher;
42         
43         @Test
44         public void getProperties() throws FileNotFoundException, IOException {
45                 
46                 assertEquals("B3705D6C2D521257CC2422ACCF03B001811ACC49F564DDB3A2CF2A1378B6D35A23CDCB696F2E1EDFBE6758DFE7C74B94F4A7DF84A0E2BB904935AC4D900D5597DF981ADE6CE1FF3AF993BED0", publisher.getAuth());
47                 assertEquals("07a7159d3bf51a0e53be7a8f89699be7", publisher.getKey());
48                 assertEquals("test.operationalEnvironmentEvent", publisher.getTopic());
49                 assertEquals("http://localhost:" + env.getProperty("wiremock.server.port"), publisher.getHost().get());
50         }
51 }