ChefApiClient Package Reorganization and cleanup 33/31933/4
authorMichal Kabaj <michal.kabaj@nokia.com>
Fri, 16 Feb 2018 10:37:35 +0000 (11:37 +0100)
committerPatrick Brady <pb071s@att.com>
Fri, 23 Feb 2018 03:10:53 +0000 (03:10 +0000)
-Reorganize ChefApiClient classes according to their usage, construction
and implementation.
-Introduce api and impl packages.
-Extract interface from ChefApiClient impl
-Remove unused old chefapi.* classes

Change-Id: Ic1ddbdcfd0e1bbc0830b923da5aac5b68ac44a2f
Issue-ID: APPC-437
Signed-off-by: Michal Kabaj <michal.kabaj@nokia.com>
17 files changed:
appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefapi/ApiMethod.java [deleted file]
appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefapi/Delete.java [deleted file]
appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefapi/Post.java [deleted file]
appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefapi/Put.java [deleted file]
appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefclient/ChefApiClientFactory.java
appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefclient/api/ChefApiClient.java [moved from appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefapi/Get.java with 64% similarity]
appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefclient/api/ChefResponse.java [moved from appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefclient/ChefResponse.java with 96% similarity]
appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefclient/impl/ChefApiClientImpl.java [moved from appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefclient/ChefApiClient.java with 89% similarity]
appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefclient/impl/ChefApiHeaderFactory.java [moved from appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefclient/ChefApiHeaderFactory.java with 93% similarity]
appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefclient/impl/ChefRequestBuilder.java [moved from appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefclient/ChefRequestBuilder.java with 94% similarity]
appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefclient/impl/FormattedTimestamp.java [moved from appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefclient/FormattedTimestamp.java with 96% similarity]
appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefclient/impl/Utils.java [moved from appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefclient/Utils.java with 98% similarity]
appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/impl/ChefAdapterImpl.java
appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/test/java/org/onap/appc/adapter/chef/chefclient/impl/ChefApiClientImplTest.java [moved from appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/test/java/org/onap/appc/adapter/chef/chefclient/ChefApiClientTest.java with 96% similarity]
appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/test/java/org/onap/appc/adapter/chef/chefclient/impl/ChefApiHeaderFactoryTest.java [moved from appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/test/java/org/onap/appc/adapter/chef/chefclient/ChefApiHeaderFactoryTest.java with 98% similarity]
appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/test/java/org/onap/appc/adapter/chef/chefclient/impl/FormattedTimestampTest.java [moved from appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/test/java/org/onap/appc/adapter/chef/chefclient/FormattedTimestampTest.java with 96% similarity]
appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/test/resources/test.properties [deleted file]

diff --git a/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefapi/ApiMethod.java b/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefapi/ApiMethod.java
deleted file mode 100644 (file)
index 8edee57..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP : APPC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Copyright (C) 2017 Amdocs
- * =============================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.appc.adapter.chef.chefapi;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.TimeZone;
-
-import org.apache.http.HttpResponse;
-import org.apache.http.Header;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpRequestBase;
-import org.apache.http.util.EntityUtils;
-import org.onap.appc.adapter.chef.chefclient.Utils;
-
-import org.apache.http.HttpEntity;
-import org.apache.http.impl.client.HttpClients;
-
-public class ApiMethod {
-    private HttpClient client = null;
-    protected HttpRequestBase method = null;
-    protected HttpResponse response = null;
-    protected String reqBody = "";
-    protected String userId = "";
-    protected String pemPath = "";
-    protected String chefPath = "";
-    protected String organizations = "";
-    protected int resCode=0;
-    protected String responseBody="";
-    private String methodName = "GET";
-    public String test = "";
-    private int returnCode;
-    final String KEY_STORE_PATH = "/etc/chef/trusted_certs/mykeystore.jks";
-    final String KEY_STORE_PASSWORD = "adminadmin";
-    static
-   {
-    System.setProperty("javax.net.ssl.trustStore", "/opt/onap/appc/chef/chefServerSSL.jks");
-    System.setProperty("javax.net.ssl.trustStorePassword", "adminadmin");
-        }
-
-    public ApiMethod(String methodName) {
-        client=HttpClients.createDefault();
-        this.methodName = methodName;
-    }
-
-   
-
-    public ApiMethod execute() {
-        String hashedPath = Utils.sha1AndBase64("/organizations/"+organizations+chefPath);
-        String hashedBody = Utils.sha1AndBase64(reqBody);
-
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
-        String timeStamp = sdf.format(new Date());
-        timeStamp = timeStamp.replace(" ", "T");
-        timeStamp = timeStamp + "Z";
-
-        StringBuilder sb = new StringBuilder();
-        sb.append("Method:").append(methodName).append("\n");
-        sb.append("Hashed Path:").append(hashedPath).append("\n");
-        sb.append("X-Ops-Content-Hash:").append(hashedBody).append("\n");
-        sb.append("X-Ops-Timestamp:").append(timeStamp).append("\n");
-        sb.append("X-Ops-UserId:").append(userId);
-        test = test + "sb " + sb + "\n";
-
-        String auth_String = Utils.signWithRSA(sb.toString(), pemPath);
-        String[] auth_headers = Utils.splitAs60(auth_String);
-
-        method.addHeader("Content-type", "application/json");
-        method.addHeader("X-Ops-Timestamp", timeStamp);
-        method.addHeader("X-Ops-Userid", userId);
-        method.addHeader("X-Chef-Version", "12.4.1");
-        method.addHeader("Accept", "application/json");
-        method.addHeader("X-Ops-Content-Hash", hashedBody);
-        method.addHeader("X-Ops-Sign", "version=1.0");
-
-        for (int i = 0; i < auth_headers.length; i++) {
-            method.addHeader("X-Ops-Authorization-" + (i + 1), auth_headers[i]);
-        }
-        try{
-            response = client.execute(method);
-            resCode = response.getStatusLine().getStatusCode();
-            HttpEntity entity1 = response.getEntity();
-            responseBody = EntityUtils.toString(entity1);}
-        catch(Exception ex){
-            resCode=500;
-            responseBody=ex.getMessage();
-        }
-        return this;
-    }
-
-    public void setHeaders(Header[] headers) {
-        for (Header header : headers) {
-            this.method.addHeader(header);
-        }
-    }
-
-    public String getResponseBodyAsString() {
-        return responseBody;
-    }
-
-    public int getReturnCode() {
-        return resCode;
-    }
-
-    public String getReqBody() {
-        return reqBody;
-    }
-
-    public void setReqBody(String body) {
-        this.reqBody = body;
-    }
-
-    public String getUserId() {
-        return userId;
-    }
-
-    public void setUserId(String userId) {
-        this.userId = userId;
-    }
-
-    public String getPemPath() {
-        return pemPath;
-    }
-
-    public void setPemPath(String pemPath) {
-        this.pemPath = pemPath;
-    }
-
-    public String getChefPath() {
-        return chefPath;
-    }
-
-    public void setChefPath(String chefPath) {
-        this.chefPath = chefPath;
-    }
-
-    public String getOrganizations() {
-        return organizations;
-    }
-
-    public void setOrganizations(String organizations) {
-        this.organizations = organizations;
-    }
-}
diff --git a/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefapi/Delete.java b/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefapi/Delete.java
deleted file mode 100644 (file)
index 5fa8a3f..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP : APPC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Copyright (C) 2017 Amdocs
- * =============================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.appc.adapter.chef.chefapi;
-
-import org.apache.http.client.methods.HttpDelete;
-
-public class Delete extends ApiMethod{
-
-    public Delete(HttpDelete method) {
-        super("DELETE");
-        this.method = method;
-    }
-
-}
diff --git a/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefapi/Post.java b/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefapi/Post.java
deleted file mode 100644 (file)
index 3234eee..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP : APPC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Copyright (C) 2017 Amdocs
- * =============================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.appc.adapter.chef.chefapi;
-
-import org.apache.http.client.methods.*;
-import org.apache.http.entity.StringEntity;
-
-public class Post extends ApiMethod{
-
-    public Post(HttpRequestBase method) {
-        super("POST");
-        this.method = method;
-    }
-
-    public ApiMethod body(String body){
-        this.reqBody = body;
-        StringEntity params =new StringEntity (body,"UTF-8");
-        params.setContentType("application/json");
-        HttpPost post = (HttpPost) method;
-        post.setEntity(params);
-        return this;
-    }
-
-}
diff --git a/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefapi/Put.java b/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/onap/appc/adapter/chef/chefapi/Put.java
deleted file mode 100644 (file)
index c96fc64..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP : APPC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Copyright (C) 2017 Amdocs
- * =============================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * 
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.appc.adapter.chef.chefapi;
-
-import org.apache.http.client.methods.*;
-import org.apache.http.entity.StringEntity;
-
-public class Put extends ApiMethod{
-
-    public Put(HttpRequestBase method) {
-        super("PUT");
-        this.method = method;
-    }
-
-    public ApiMethod body(String body){
-        this.reqBody = body;
-        StringEntity params =new StringEntity (body,"UTF-8");
-        params.setContentType("application/json");
-        HttpPut put = (HttpPut) method;
-        put.setEntity(params);
-        return this;
-    }
-
-}
index b3c4272..a69ccf1 100644 (file)
@@ -21,6 +21,9 @@ package org.onap.appc.adapter.chef.chefclient;
 
 import org.apache.http.client.HttpClient;
 import org.apache.http.impl.client.HttpClients;
+import org.onap.appc.adapter.chef.chefclient.api.ChefApiClient;
+import org.onap.appc.adapter.chef.chefclient.impl.ChefApiClientImpl;
+import org.onap.appc.adapter.chef.chefclient.impl.ChefApiHeaderFactory;
 
 public final class ChefApiClientFactory {
 
@@ -28,7 +31,7 @@ public final class ChefApiClientFactory {
     private ChefApiHeaderFactory chefApiHeaderFactory = new ChefApiHeaderFactory();
 
     public ChefApiClient create(String endPoint, String organizations, String userId, String pemPath) {
-        return new ChefApiClient(httpClient,
+        return new ChefApiClientImpl(httpClient,
             chefApiHeaderFactory,
             endPoint,
             organizations,
@@ -1,35 +1,31 @@
-/*-
+/*
  * ============LICENSE_START=======================================================
  * ONAP : APPC
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Copyright (C) 2017 Amdocs
+ * Copyright (C) 2018 Nokia. All rights reserved.
  * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
  * ============LICENSE_END=========================================================
  */
+package org.onap.appc.adapter.chef.chefclient.api;
+
+public interface ChefApiClient {
 
-package org.onap.appc.adapter.chef.chefapi;
+    ChefResponse get(String path);
 
-import org.apache.http.client.methods.HttpGet;
+    ChefResponse delete(String path);
 
-public class Get extends ApiMethod{
+    ChefResponse post(String path, String body);
 
-    public Get(HttpGet method) {
-        super("GET");
-        this.method = method;
-    }
+    ChefResponse put(String path, String body);
 }
@@ -22,7 +22,7 @@
  * ============LICENSE_END=========================================================
  */
 
-package org.onap.appc.adapter.chef.chefclient;
+package org.onap.appc.adapter.chef.chefclient.impl;
 
 import java.io.IOException;
 import java.net.URISyntaxException;
@@ -31,9 +31,11 @@ import org.apache.http.HttpResponse;
 import org.apache.http.HttpStatus;
 import org.apache.http.client.HttpClient;
 import org.apache.http.util.EntityUtils;
-import org.onap.appc.adapter.chef.chefclient.ChefRequestBuilder.OngoingRequestBuilder;
+import org.onap.appc.adapter.chef.chefclient.api.ChefApiClient;
+import org.onap.appc.adapter.chef.chefclient.api.ChefResponse;
+import org.onap.appc.adapter.chef.chefclient.impl.ChefRequestBuilder.OngoingRequestBuilder;
 
-public class ChefApiClient {
+public class ChefApiClientImpl implements ChefApiClient {
 
     private final HttpClient httpClient;
     private final ChefApiHeaderFactory chefApiHeaderFactory;
@@ -42,7 +44,7 @@ public class ChefApiClient {
     private String pemPath;
     private String organizations;
 
-    ChefApiClient(HttpClient httpClient, ChefApiHeaderFactory chefApiHeaderFactory,
+    public ChefApiClientImpl(HttpClient httpClient, ChefApiHeaderFactory chefApiHeaderFactory,
         String endpoint, String organizations, String userId, String pemPath) {
         this.httpClient = httpClient;
         this.chefApiHeaderFactory = chefApiHeaderFactory;
@@ -52,6 +54,7 @@ public class ChefApiClient {
         this.pemPath = pemPath;
     }
 
+    @Override
     public ChefResponse get(String path) {
         OngoingRequestBuilder requestBuilder = ChefRequestBuilder.newRequestTo(endpoint)
             .httpGet()
@@ -60,6 +63,7 @@ public class ChefApiClient {
         return execute(requestBuilder);
     }
 
+    @Override
     public ChefResponse delete(String path) {
         OngoingRequestBuilder requestBuilder = ChefRequestBuilder.newRequestTo(endpoint)
             .httpDelete()
@@ -68,6 +72,7 @@ public class ChefApiClient {
         return execute(requestBuilder);
     }
 
+    @Override
     public ChefResponse post(String path, String body) {
         OngoingRequestBuilder requestBuilder = ChefRequestBuilder.newRequestTo(endpoint)
             .httpPost(body)
@@ -76,6 +81,7 @@ public class ChefApiClient {
         return execute(requestBuilder);
     }
 
+    @Override
     public ChefResponse put(String path, String body) {
         OngoingRequestBuilder requestBuilder = ChefRequestBuilder.newRequestTo(endpoint)
             .httpPut(body)
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
-package org.onap.appc.adapter.chef.chefclient;
+package org.onap.appc.adapter.chef.chefclient.impl;
 
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableMap.Builder;
 import java.util.Date;
 
-class ChefApiHeaderFactory {
+public class ChefApiHeaderFactory {
 
     private FormattedTimestamp formattedTimestamp = new FormattedTimestamp();
 
@@ -32,7 +32,7 @@ class ChefApiHeaderFactory {
         System.setProperty("javax.net.ssl.trustStorePassword", "adminadmin");
     }
 
-    ImmutableMap<String, String> create(String methodName, String path, String body, String userId,
+    public ImmutableMap<String, String> create(String methodName, String path, String body, String userId,
         String organizations, String pemPath) {
 
         String hashedBody = Utils.sha1AndBase64(body);
@@ -17,7 +17,7 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
-package org.onap.appc.adapter.chef.chefclient;
+package org.onap.appc.adapter.chef.chefclient.impl;
 
 import com.google.common.collect.ImmutableMap;
 import java.net.URI;
@@ -31,16 +31,16 @@ import org.apache.http.client.methods.HttpRequestBase;
 import org.apache.http.client.utils.URIBuilder;
 import org.apache.http.entity.StringEntity;
 
-public final class ChefRequestBuilder {
+final class ChefRequestBuilder {
 
     private ChefRequestBuilder() {
     }
 
-    public static OngoingRequestBuilder newRequestTo(String endPoint) {
+    static OngoingRequestBuilder newRequestTo(String endPoint) {
         return new OngoingRequestBuilder(endPoint);
     }
 
-    public static class OngoingRequestBuilder {
+    static class OngoingRequestBuilder {
 
         private HttpRequestBase httpRequestBase;
         private String endPoint;
index 65e64f8..eb5ee7b 100644 (file)
@@ -38,10 +38,9 @@ import org.apache.http.util.EntityUtils;
 import org.json.JSONException;
 import org.json.JSONObject;
 import org.onap.appc.adapter.chef.ChefAdapter;
-import org.onap.appc.adapter.chef.chefapi.ApiMethod;
-import org.onap.appc.adapter.chef.chefclient.ChefApiClient;
+import org.onap.appc.adapter.chef.chefclient.api.ChefApiClient;
 import org.onap.appc.adapter.chef.chefclient.ChefApiClientFactory;
-import org.onap.appc.adapter.chef.chefclient.ChefResponse;
+import org.onap.appc.adapter.chef.chefclient.api.ChefResponse;
 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
 import com.att.eelf.configuration.EELFLogger;
@@ -17,7 +17,7 @@
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
-package org.onap.appc.adapter.chef.chefclient;
+package org.onap.appc.adapter.chef.chefclient.impl;
 
 import static junit.framework.TestCase.assertEquals;
 import static org.mockito.BDDMockito.given;
@@ -43,9 +43,12 @@ import org.mockito.ArgumentMatcher;
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.runners.MockitoJUnitRunner;
+import org.onap.appc.adapter.chef.chefclient.ChefApiClientFactory;
+import org.onap.appc.adapter.chef.chefclient.api.ChefApiClient;
+import org.onap.appc.adapter.chef.chefclient.api.ChefResponse;
 
 @RunWith(MockitoJUnitRunner.class)
-public class ChefApiClientTest {
+public class ChefApiClientImplTest {
 
     private static final String END_POINT = "https://chefServer";
     private static final String ORGANIZATIONS_PATH = "onap";
diff --git a/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/test/resources/test.properties b/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/test/resources/test.properties
deleted file mode 100644 (file)
index 09d4208..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-# ============LICENSE_START==========================================
-# ONAP : APPC
-# ===================================================================
-# Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
-# ===================================================================
-#
-# Unless otherwise specified, all software contained herein is licensed
-# under the Apache License, Version 2.0 (the License);
-# you may not use this software except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#    http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
-# ============LICENSE_END============================================
-org.onap.appc.adapter.chef.chefclient.userId=test
-org.onap.appc.adapter.chef.chefclient.pemPath=/src/test/resources/testclient.pem
-org.onap.appc.adapter.chef.chefclient.endPoint=http://127.0.0.1
-org.onap.appc.adapter.chef.chefclient.organizations=onap
-org.onap.appc.adapter.chef.chefclient.path=/test/path