Package com.proofpoint.http.client

Examples of com.proofpoint.http.client.HttpClient


        httpServerInfo = new HttpServerInfo(config, nodeInfo);

        createServer();
        server.start();

        HttpClient client = new JettyHttpClient();
        StatusResponse response = client.execute(prepareGet().setUri(httpServerInfo.getHttpsUri()).build(), createStatusResponseHandler());

        assertEquals(response.getStatusCode(), HttpServletResponse.SC_OK);
    }
View Full Code Here


    @Test
    public void testGetStats()
    {
        RequestStats requestStats = new RequestStats();
        HttpClient mockClient = mock(HttpClient.class);
        when(mockClient.getStats()).thenReturn(requestStats);

        balancingHttpClient = new BalancingHttpClient(serviceBalancer, mockClient, new BalancingHttpClientConfig());
        assertSame(balancingHttpClient.getStats(), requestStats);

        verify(mockClient).getStats();
View Full Code Here

    }

    @Test
    public void testClose()
    {
        HttpClient mockClient = mock(HttpClient.class);

        balancingHttpClient = new BalancingHttpClient(serviceBalancer, mockClient, new BalancingHttpClientConfig());
        balancingHttpClient.close();

        verify(mockClient).close();
View Full Code Here

    @Test
    public void testGetStats()
    {
        RequestStats requestStats = new RequestStats();
        HttpClient mockClient = mock(HttpClient.class);
        when(mockClient.getStats()).thenReturn(requestStats);

        balancingHttpClient = new SyncToAsyncWrapperClient(
                new BalancingHttpClient(serviceBalancer, mockClient, new BalancingHttpClientConfig()));
        assertSame(balancingHttpClient.getStats(), requestStats);
View Full Code Here

    }

    @Test
    public void testClose()
    {
        HttpClient mockClient = mock(HttpClient.class);

        balancingHttpClient = new SyncToAsyncWrapperClient(
                new BalancingHttpClient(serviceBalancer, mockClient, new BalancingHttpClientConfig()));
        balancingHttpClient.close();
View Full Code Here

                                .withAliases(ImmutableList.of(FooAlias2.class, FooAlias3.class));
                    }
                }
        );

        HttpClient client = injector.getInstance(Key.get(HttpClient.class, FooClient.class));
        assertSame(injector.getInstance(Key.get(HttpClient.class, FooAlias1.class)), client);
        assertSame(injector.getInstance(Key.get(HttpClient.class, FooAlias2.class)), client);
        assertSame(injector.getInstance(Key.get(HttpClient.class, FooAlias3.class)), client);

    }
View Full Code Here

                                .withAliases(ImmutableList.of(FooAlias2.class, FooAlias3.class));
                    }
                }
        );

        HttpClient client = injector.getInstance(Key.get(AsyncHttpClient.class, FooClient.class));
        assertSame(injector.getInstance(Key.get(AsyncHttpClient.class, FooAlias1.class)), client);
        assertSame(injector.getInstance(Key.get(AsyncHttpClient.class, FooAlias2.class)), client);
        assertSame(injector.getInstance(Key.get(AsyncHttpClient.class, FooAlias3.class)), client);

    }
View Full Code Here

TOP

Related Classes of com.proofpoint.http.client.HttpClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.