content: package com.afrozaar.wordpress.wpapi.v2;
  
  import com.afrozaar.wordpress.wpapi.v2.config.ClientConfig;
  import com.afrozaar.wordpress.wpapi.v2.config.ClientFactory;
  
  import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
  
  import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
  import org.apache.http.conn.ssl.SSLContexts;
  import org.apache.http.conn.ssl.TrustStrategy;
  import org.apache.http.impl.client.CloseableHttpClient;
  import org.apache.http.impl.client.HttpClients;
  import org.junit.Ignore;
  import org.junit.Test;
  
  import javax.net.ssl.SSLContext;
  
  import java.security.KeyManagementException;
  import java.security.KeyStoreException;
  import java.security.NoSuchAlgorithmException;
  import java.security.cert.X509Certificate;
  
  public class ClientWithRequestBuilderTest {
  
      @Ignore
      @Test
      public void buildClient() throws KeyStoreException, NoSuchAlgorithmException, KeyManagementException {
  
          TrustStrategy acceptingTrustStrategy = (X509Certificate[] chain, String authType) -> true;
  
          SSLContext sslContext = SSLContexts.custom()
                  .loadTrustMaterial(null, acceptingTrustStrategy)
                  .build();
  
          SSLConnectionSocketFactory csf = new SSLConnectionSocketFactory(sslContext);
  
          CloseableHttpClient httpClient = HttpClients.custom()
                  .setSSLSocketFactory(csf)
                  .build();
  
          HttpComponentsClientHttpRequestFactory requestFactory =
                  new HttpComponentsClientHttpRequestFactory();
  
          requestFactory.setHttpClient(httpClient);
  
          String baseUrl = "someUrl";
          String username = "username";
          String password = "password";
          boolean debug = false;
          boolean usePermalinkEndpoint = true;
  
          final Wordpress wordpress = ClientFactory.builder(ClientConfig.of(baseUrl, username, password, usePermalinkEndpoint, debug))
                  .withRequestFactory(requestFactory)
                  .build();
  
      }
  }
  