First part of onap rename
[appc.git] / appc-config / appc-flow-controller / provider / src / test / java / org / openecomp / appc / flow / executor / node / RestExecutorTest.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * ONAP : APPC\r
4  * ================================================================================\r
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
6  * ================================================================================\r
7  * Copyright (C) 2017 Amdocs\r
8  * =============================================================================\r
9  * Licensed under the Apache License, Version 2.0 (the "License");\r
10  * you may not use this file except in compliance with the License.\r
11  * You may obtain a copy of the License at\r
12  *\r
13  *      http://www.apache.org/licenses/LICENSE-2.0\r
14  *\r
15  * Unless required by applicable law or agreed to in writing, software\r
16  * distributed under the License is distributed on an "AS IS" BASIS,\r
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
18  * See the License for the specific language governing permissions and\r
19  * limitations under the License.\r
20  *\r
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
22  * ============LICENSE_END=========================================================\r
23  */\r
24 \r
25 package org.onap.appc.flow.executor.node;\r
26 \r
27 import static org.mockito.Matchers.any;\r
28 import static org.mockito.Matchers.anyString;\r
29 import static org.mockito.Mockito.doReturn;\r
30 import static org.mockito.Mockito.mock;\r
31 import static org.mockito.Mockito.when;\r
32 \r
33 import java.net.URI;\r
34 import java.security.KeyManagementException;\r
35 import java.security.NoSuchAlgorithmException;\r
36 \r
37 import javax.net.ssl.SSLContext;\r
38 import javax.ws.rs.core.MediaType;\r
39 \r
40 import org.junit.After;\r
41 import org.junit.AfterClass;\r
42 import org.junit.Assert;\r
43 import org.junit.Before;\r
44 import org.junit.BeforeClass;\r
45 import org.junit.Test;\r
46 import org.mockito.InjectMocks;\r
47 import org.mockito.Mock;\r
48 import org.mockito.Mockito;\r
49 import org.onap.appc.flow.controller.executorImpl.RestExecutor;\r
50 import org.powermock.api.mockito.PowerMockito;\r
51 \r
52 import com.sun.jersey.api.client.Client;\r
53 import com.sun.jersey.api.client.ClientResponse;\r
54 import com.sun.jersey.api.client.config.DefaultClientConfig;\r
55 import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter;\r
56 \r
57 public class RestExecutorTest {\r
58         \r
59     \r
60     private static final String URL = null;\r
61 \r
62         @Mock\r
63         private DefaultClientConfig clientConfig;\r
64 \r
65         @Mock\r
66         private com.sun.jersey.api.client.WebResource webResource;\r
67         \r
68         @InjectMocks\r
69         private Client client;\r
70         @Mock\r
71         private ClientResponse res;\r
72         @Mock\r
73         URI resourceUri;\r
74 @Mock\r
75 RestExecutor restEx;\r
76         @BeforeClass\r
77         public static void setUpBeforeClass() throws Exception {\r
78         }\r
79 \r
80         @AfterClass\r
81         public static void tearDownAfterClass() throws Exception {\r
82         }\r
83 \r
84         @Before\r
85         public void setUp() throws Exception {\r
86                 clientConfig = Mockito.mock(DefaultClientConfig.class);\r
87                  Client mockClient = Client.create();\r
88                  client = Client.create(clientConfig);\r
89                 doReturn(mockClient).when(client).create();\r
90                 webResource= mockClient.resource(URL);\r
91                 doReturn(webResource).when(mockClient).resource(URL);\r
92                 when(webResource.get((Class<String>) any())).thenReturn("OK")   ;        \r
93         }\r
94 \r
95         @After\r
96         public void tearDown() throws Exception {\r
97         }\r
98 \r
99         \r
100 \r
101 \r
102         \r
103 }\r