2 * Copyright © 2017-2018 AT&T Intellectual Property.
\r
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
\r
5 * in compliance with the License. You may obtain a copy of the License at
\r
7 * http://www.apache.org/licenses/LICENSE-2.0
\r
9 * Unless required by applicable law or agreed to in writing, software distributed under the License
\r
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
\r
11 * or implied. See the License for the specific language governing permissions and limitations under
\r
15 package org.onap.ccsdk.config.rest.adaptor.service;
\r
17 import java.io.FileInputStream;
\r
18 import java.util.HashMap;
\r
19 import java.util.Map;
\r
20 import java.util.Properties;
\r
21 import java.util.stream.Collectors;
\r
22 import org.junit.Assert;
\r
23 import org.junit.Before;
\r
24 import org.junit.Test;
\r
26 public class AbstractConfigRestClientAdapterTest {
\r
28 Map<String, String> properties = new HashMap<>();
\r
31 public void setup() throws Exception {
\r
32 String propertyfile = "src/test/resources/config-rest-adaptor.properties";
\r
34 Properties restProperties = new Properties();
\r
35 restProperties.load(new FileInputStream(propertyfile));
\r
37 properties.putAll(restProperties.entrySet().stream()
\r
38 .collect(Collectors.toMap(e -> e.getKey().toString(), e -> e.getValue().toString())));
\r
42 public void testInitGenericRestClient() throws Exception {
\r
43 ConfigRestClientServiceAdapter genericRestClient = new GenericRestClientAdapterImpl(properties, "modelservice");
\r
44 Assert.assertNotNull(genericRestClient);
\r
48 public void testInitSSLClient() throws Exception {
\r
49 ConfigRestClientServiceAdapter sslClient = new SSLRestClientAdapterImpl(properties, "aai");
\r
50 Assert.assertNotNull(sslClient);
\r