Package org.mockserver.proxy.http

Examples of org.mockserver.proxy.http.HttpProxyBuilder


    private final HttpProxy httpProxy;

    public ClientAndProxy(Integer port) {
        super("localhost", port);
        httpProxy = new HttpProxyBuilder().withHTTPPort(port).build();
    }
View Full Code Here


        httpProxy = new HttpProxyBuilder().withHTTPPort(port).build();
    }

    public ClientAndProxy(Integer port, Integer securePort) {
        super("localhost", port);
        httpProxy = new HttpProxyBuilder().withHTTPPort(port).withHTTPSPort(securePort).build();
    }
View Full Code Here

        // start server
        testServer.startServer(SERVER_HTTP_PORT, SERVER_HTTPS_PORT);

        // start proxy
        httpProxy = new HttpProxyBuilder()
                .withHTTPPort(PROXY_HTTP_PORT)
                .withHTTPSPort(PROXY_HTTPS_PORT)
                .withSOCKSPort(PROXY_SOCKS_PORT)
                .withDirect(PROXY_DIRECT_PORT, "127.0.0.1", SERVER_HTTP_PORT)
                .withDirectSSL(PROXY_DIRECT_SECURE_PORT, "127.0.0.1", SERVER_HTTPS_PORT)
View Full Code Here

        // start server
        testServer.startServer(SERVER_HTTP_PORT, SERVER_HTTPS_PORT);

        // start proxy
        httpProxy = new HttpProxyBuilder()
                .withDirect(PROXY_DIRECT_PORT, "127.0.0.1", SERVER_HTTP_PORT)
                .build();
    }
View Full Code Here

        // start server
        testServer.startServer(SERVER_HTTP_PORT, SERVER_HTTPS_PORT);

        // start proxy
        httpProxy = new HttpProxyBuilder()
                .withDirectSSL(PROXY_DIRECT_SECURE_PORT, "127.0.0.1", SERVER_HTTPS_PORT)
                .build();
    }
View Full Code Here

    private final static int serverSecurePort = PortFactory.findFreePort();

    @Test
    public void canStartAndStopMultipleTimes() {
        // start server
        HttpProxy httpProxy = new HttpProxyBuilder().withHTTPPort(serverPort).withHTTPSPort(serverSecurePort).build();

        // start client
        ProxyClient proxyClient = new ProxyClient("localhost", serverPort);

        for (int i = 0; i < 2; i++) {
            // when
            proxyClient.stop();

            // then
            assertFalse(httpProxy.isRunning());
            httpProxy = new HttpProxyBuilder().withHTTPPort(serverPort).withHTTPSPort(serverSecurePort).build();
            assertTrue(httpProxy.isRunning());
        }

        assertTrue(httpProxy.isRunning());
        httpProxy.stop();
View Full Code Here

    }

    @Test
    public void canStartAndStopMultipleTimesWithNewProcess() {
        // start server
        HttpProxy httpProxy = new HttpProxyBuilder().withHTTPPort(serverPort).withHTTPSPort(serverSecurePort).build();

        // start client
        MockServerClient mockServerClient = new MockServerClient("localhost", serverPort);

        for (int i = 0; i < 2; i++) {
            // when
            mockServerClient.stop();

            // then
            assertFalse(httpProxy.isRunning());
            httpProxy = new HttpProxyBuilder().withHTTPPort(serverPort).withHTTPSPort(serverSecurePort).build();
            assertTrue(httpProxy.isRunning());
        }

        assertTrue(httpProxy.isRunning());
        httpProxy.stop();
View Full Code Here

TOP

Related Classes of org.mockserver.proxy.http.HttpProxyBuilder

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.