2 * ================================================================================
3 * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 * ============LICENSE_END=========================================================
20 package org.onap.dcae.analytics.web;
22 import org.junit.jupiter.api.BeforeAll;
23 import org.onap.dcae.analytics.test.BaseAnalyticsUnitTest;
25 import java.util.HashMap;
27 import static org.onap.dcae.analytics.model.configbindingservice.ConfigBindingServiceConstants.CONFIG_BINDING_SERVICE_ENV_VARIABLE_KEY;
28 import static org.onap.dcae.analytics.model.configbindingservice.ConfigBindingServiceConstants.CONSUL_HOST_ENV_VARIABLE_KEY;
29 import static org.onap.dcae.analytics.model.configbindingservice.ConfigBindingServiceConstants.SERVICE_NAME_ENV_VARIABLE_KEY;
32 * @author Rajiv Singla
34 public abstract class BaseAnalyticsWebTest extends BaseAnalyticsUnitTest {
36 public static void initializeConfigBindingServiceEnvironmentVariables() throws Exception {
37 // sets up environment variables for testing purposes
38 final HashMap<String, String> testEnvironmentVariables = new HashMap<>();
39 final String testConsulHostValue = "localhost";
40 final String testConfigBindingService = "config_binding_service";
41 final String testServiceName = "tca_dev";
42 testEnvironmentVariables.put(CONSUL_HOST_ENV_VARIABLE_KEY, testConsulHostValue);
43 testEnvironmentVariables.put(CONFIG_BINDING_SERVICE_ENV_VARIABLE_KEY, testConfigBindingService);
44 testEnvironmentVariables.put(SERVICE_NAME_ENV_VARIABLE_KEY, testServiceName);
45 setEnvironmentVariables(testEnvironmentVariables);