e698567a04d1e971f2762359be7540ed2e2c84dd
[ccsdk/features.git] /
1 /*\r
2  * Copyright © 2017-2018 AT&T Intellectual Property.\r
3  * \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
6  * \r
7  * http://www.apache.org/licenses/LICENSE-2.0\r
8  * \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
12  * the License.\r
13  */\r
14 \r
15 package org.onap.ccsdk.config.rest.adaptor.service;\r
16 \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
25 \r
26 public class AbstractConfigRestClientAdapterTest {\r
27     \r
28     Map<String, String> properties = new HashMap<>();\r
29     \r
30     @Before\r
31     public void setup() throws Exception {\r
32         String propertyfile = "src/test/resources/config-rest-adaptor.properties";\r
33         \r
34         Properties restProperties = new Properties();\r
35         restProperties.load(new FileInputStream(propertyfile));\r
36         \r
37         properties.putAll(restProperties.entrySet().stream()\r
38                 .collect(Collectors.toMap(e -> e.getKey().toString(), e -> e.getValue().toString())));\r
39     }\r
40     \r
41     @Test\r
42     public void testInitGenericRestClient() throws Exception {\r
43         ConfigRestClientServiceAdapter genericRestClient = new GenericRestClientAdapterImpl(properties, "modelservice");\r
44         Assert.assertNotNull(genericRestClient);\r
45     }\r
46     \r
47     @Test\r
48     public void testInitSSLClient() throws Exception {\r
49         ConfigRestClientServiceAdapter sslClient = new SSLRestClientAdapterImpl(properties, "aai");\r
50         Assert.assertNotNull(sslClient);\r
51     }\r
52     \r
53 }\r