@Override
    public OkHttpClient get() {
        final OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder()
                .retryOnConnectionFailure(true)
                .connectTimeout(connectTimeout.getQuantity(), connectTimeout.getUnit())
                .writeTimeout(writeTimeout.getQuantity(), writeTimeout.getUnit())
                .readTimeout(readTimeout.getQuantity(), readTimeout.getUnit());

        if (trustManagerAndSocketFactoryProvider != null) {
            // always set our own CA, might be overriden in later code
            clientBuilder.sslSocketFactory(trustManagerAndSocketFactoryProvider.getSslSocketFactory(), trustManagerAndSocketFactoryProvider.getTrustManager());
        }

        if (httpProxyUri != null) {
            clientBuilder.proxySelector(proxySelectorProvider.get());

            if (!isNullOrEmpty(httpProxyUri.getUserInfo())) {
                final List<String> list = Splitter.on(":")
                        .limit(2)
                        .splitToList(httpProxyUri.getUserInfo());
                if (list.size() == 2) {
                    clientBuilder.proxyAuthenticator(new ProxyAuthenticator(list.get(0), list.get(1)));
                }
            }
        }

        return clientBuilder.build();
    }
@Test
    public void testSuccessfulConnectionWithoutProxy() throws IOException, InterruptedException {
        server.enqueue(successfulMockResponse());

        final Request request = new Request.Builder().url(server.url("/")).get().build();
        final Response response = client(null).newCall(request).execute();
        assertThat(response.isSuccessful()).isTrue();
        final ResponseBody body = response.body();
        assertThat(body).isNotNull();
        assertThat(body.string()).isEqualTo("Test");

        assertThat(server.getRequestCount()).isEqualTo(1);
        final RecordedRequest recordedRequest = server.takeRequest();
        assertThat(recordedRequest.getMethod()).isEqualTo("GET");
        assertThat(recordedRequest.getPath()).isEqualTo("/");
    }