2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.mso.apihandlerinfra.tenantisolation.dmaap;
23 import static org.junit.Assert.assertEquals;
25 import java.io.FileNotFoundException;
26 import java.io.IOException;
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;
35 public class OperationalEnvironmentPublisherTest {
37 private static final String APIH_INFRA_PROP = MsoJavaProperties.class.getClassLoader().getResource("mso.apihandler-infra.properties").toString().substring(5);
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);
47 public void getProperties() throws FileNotFoundException, IOException {
48 OperationalEnvironmentPublisher publisher = new OperationalEnvironmentPublisher();
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());