AT&T 1712 and 1802 release code
[so.git] / mso-api-handlers / mso-api-handler-infra / src / test / java / org / openecomp / mso / 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.openecomp.mso.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.BeforeClass;
29 import org.junit.Test;
30 import org.openecomp.mso.apihandlerinfra.tenantisolation.dmaap.OperationalEnvironmentPublisher;
31 import org.openecomp.mso.properties.MsoJavaProperties;
32 import org.openecomp.mso.properties.MsoPropertiesException;
33 import org.openecomp.mso.properties.MsoPropertiesFactory;
34
35 public class OperationalEnvironmentPublisherTest {
36
37         private static final String APIH_INFRA_PROP = MsoJavaProperties.class.getClassLoader().getResource("mso.apihandler-infra.properties").toString().substring(5);
38         
39         @BeforeClass
40         public static void setUp() throws MsoPropertiesException {
41                 MsoPropertiesFactory propertiesFactory = new MsoPropertiesFactory();
42                 propertiesFactory.removeAllMsoProperties();
43                 propertiesFactory.initializeMsoProperties("MSO_PROP_APIHANDLER_INFRA", APIH_INFRA_PROP);
44         }
45         
46         @Test
47         public void getProperties() throws FileNotFoundException, IOException {
48                 OperationalEnvironmentPublisher publisher = new OperationalEnvironmentPublisher();
49                 
50                 assertEquals("m97898@mso.ecomp.att.com", publisher.getUserName());
51                 assertEquals("VjR5NDcxSzA=", publisher.getPassword());
52                 assertEquals("com.att.ecomp.mso.operationalEnvironmentEvent", publisher.getTopic());
53                 assertEquals("https://dcae-mrtr-ftl3.ecomp.cci.att.com:3905", publisher.getHost().get());
54         }
55 }