AAI-1523 Batch reformat aai-rest
[aai/aai-common.git] / aai-rest / src / main / java / org / onap / aai / restclient / TwoWaySSLRestClient.java
index dd5deaa..a69977f 100644 (file)
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.aai.restclient;
 
 import com.att.eelf.configuration.EELFLogger;
 import com.att.eelf.configuration.EELFManager;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.security.KeyStore;
+
+import javax.annotation.PostConstruct;
+import javax.net.ssl.SSLContext;
+
 import org.apache.http.client.HttpClient;
 import org.apache.http.impl.client.HttpClients;
 import org.apache.http.ssl.SSLContextBuilder;
@@ -29,13 +39,6 @@ import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
 import org.springframework.util.ResourceUtils;
 import org.springframework.web.client.RestTemplate;
 
-import javax.annotation.PostConstruct;
-import javax.net.ssl.SSLContext;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.security.KeyStore;
-
 public abstract class TwoWaySSLRestClient extends RestClient {
 
     private static EELFLogger logger = EELFManager.getInstance().getLogger(TwoWaySSLRestClient.class);
@@ -51,20 +54,15 @@ public abstract class TwoWaySSLRestClient extends RestClient {
         String keyStore = getKeystorePath();
         String trustStore = getTruststorePath();
 
-        SSLContext sslContext = SSLContextBuilder
-            .create()
-            .loadKeyMaterial(loadPfx(keyStore, keyStorePassword), keyStorePassword)
-            .loadTrustMaterial(ResourceUtils.getFile(trustStore), trustStorePassword)
-            .build();
+        SSLContext sslContext =
+                SSLContextBuilder.create().loadKeyMaterial(loadPfx(keyStore, keyStorePassword), keyStorePassword)
+                        .loadTrustMaterial(ResourceUtils.getFile(trustStore), trustStorePassword).build();
 
-        HttpClient client = HttpClients.custom()
-            .setSSLContext(sslContext)
-            .setSSLHostnameVerifier((s, sslSession) -> true)
-            .build();
+        HttpClient client =
+                HttpClients.custom().setSSLContext(sslContext).setSSLHostnameVerifier((s, sslSession) -> true).build();
 
-        restTemplate = new RestTemplateBuilder()
-            .requestFactory(new HttpComponentsClientHttpRequestFactory(client))
-            .build();
+        restTemplate =
+                new RestTemplateBuilder().requestFactory(new HttpComponentsClientHttpRequestFactory(client)).build();
 
         restTemplate.setErrorHandler(new RestClientResponseErrorHandler());