Sonar Fix: ChefApiClientFactory.java
[appc.git] / appc-adapters / appc-chef-adapter / appc-chef-adapter-bundle / src / main / java / org / onap / appc / adapter / chef / chefclient / ChefApiClientFactory.java
index c41142c..9a657c9 100644 (file)
@@ -41,6 +41,9 @@ public class ChefApiClientFactory {
 
     private static final EELFLogger logger = EELFManager.getInstance().getLogger(ChefApiClientFactory.class);
 
+    private HttpClient httpClient = createChefHttpClient();
+    private ChefApiHeaderFactory chefApiHeaderFactory = new ChefApiHeaderFactory();
+
     private HttpClient createChefHttpClient() {
         String trustStoreFileName = "/opt/app/bvc/chef/chefServerSSL.jks";
         char[] trustStoreCreds = "adminadmin".toCharArray();
@@ -56,9 +59,6 @@ public class ChefApiClientFactory {
         return null;
     }
 
-    private HttpClient httpClient = createChefHttpClient();
-    private ChefApiHeaderFactory chefApiHeaderFactory = new ChefApiHeaderFactory();
-
     public ChefApiClient create(String endPoint, String organizations, String userId, String pemPath) {
         return new ChefApiClientImpl(httpClient, endPoint, organizations, (methodName, requestPath, body) -> chefApiHeaderFactory
                 .create(methodName, requestPath, body, userId, organizations, pemPath));