2 * ============LICENSE_START=======================================================
\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
13 * http://www.apache.org/licenses/LICENSE-2.0
\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
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
\r
22 * ============LICENSE_END=========================================================
\r
25 package org.onap.appc.flow.executor.node;
\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
33 import java.net.URI;
\r
34 import java.security.KeyManagementException;
\r
35 import java.security.NoSuchAlgorithmException;
\r
37 import javax.net.ssl.SSLContext;
\r
38 import javax.ws.rs.core.MediaType;
\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
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
57 public class RestExecutorTest {
\r
60 private static final String URL = null;
\r
63 private DefaultClientConfig clientConfig;
\r
66 private com.sun.jersey.api.client.WebResource webResource;
\r
69 private Client client;
\r
71 private ClientResponse res;
\r
75 RestExecutor restEx;
\r
77 public static void setUpBeforeClass() throws Exception {
\r
81 public static void tearDownAfterClass() throws Exception {
\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
96 public void tearDown() throws Exception {
\r