59df7ae960a7bf80fd7a1316c81cff7afe7333d6
[so.git] /
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("testuser", publisher.getUserName());
47                 assertEquals("VjR5NDcxSzA=", publisher.getPassword());
48                 assertEquals("test.operationalEnvironmentEvent", publisher.getTopic());
49                 assertEquals("http://localhost:" + env.getProperty("wiremock.server.port"), publisher.getHost().get());
50         }
51 }