Package org.mockserver.integration

Source Code of org.mockserver.integration.ClientAndProxy

package org.mockserver.integration;

import org.mockserver.client.proxy.ProxyClient;
import org.mockserver.proxy.http.HttpProxy;
import org.mockserver.proxy.http.HttpProxyBuilder;

/**
* @author jamesdbloom
*/
public class ClientAndProxy extends ProxyClient {

    private final HttpProxy httpProxy;

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

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

    public static ClientAndProxy startClientAndProxy(Integer port) {
        return new ClientAndProxy(port);
    }

    public static ClientAndProxy startClientAndProxy(Integer port, Integer securePort) {
        return new ClientAndProxy(port, securePort);
    }

    public boolean isRunning() {
        return httpProxy.isRunning();
    }
}
TOP

Related Classes of org.mockserver.integration.ClientAndProxy

TOP
Copyright © 2018 www.massapi.com. 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.