Decouple ChefApiClientImpl from header creation
[appc.git] / appc-adapters / appc-chef-adapter / appc-chef-adapter-bundle / src / main / java / org / onap / appc / adapter / chef / chefclient / ChefApiClientFactory.java
index 818d516..1815266 100644 (file)
@@ -31,11 +31,10 @@ public class ChefApiClientFactory {
     private ChefApiHeaderFactory chefApiHeaderFactory = new ChefApiHeaderFactory();
 
     public ChefApiClient create(String endPoint, String organizations, String userId, String pemPath) {
-        return new ChefApiClientImpl(httpClient,
-            chefApiHeaderFactory,
+        return new ChefApiClientImpl(
+            httpClient,
             endPoint,
-            organizations,
-            userId,
-            pemPath);
+            (methodName, requestPath, body) -> chefApiHeaderFactory
+                .create(methodName, requestPath, body, userId, organizations, pemPath));
     }
 }