Package com.github.tomakehurst.wiremock.common

Examples of com.github.tomakehurst.wiremock.common.ProxySettings


    @Test
    public void canProxyViaAForwardProxy() {
        WireMockServer forwardProxy = new WireMockServer(wireMockConfig().port(8187).enableBrowserProxying(true));
        forwardProxy.start();
        init(wireMockConfig().proxyVia(new ProxySettings("localhost", 8187)));

        targetServiceAdmin.register(get(urlEqualTo("/proxy-via")).willReturn(aResponse().withStatus(200)));
        proxyingServiceAdmin.register(get(urlEqualTo("/proxy-via")).willReturn(aResponse().proxiedFrom(TARGET_SERVICE_BASE_URL)));

        assertThat(testClient.get("/proxy-via").statusCode(), is(200));
View Full Code Here


        assertThat(ProxySettings.fromString("myhost.com").port(), is(80));
    }

    @Test
    public void parsesHostAndPortCorrectly() {
        ProxySettings settings = ProxySettings.fromString("some.host.org:8888");
        assertThat(settings.host(), is("some.host.org"));
        assertThat(settings.port(), is(8888));
    }
View Full Code Here

TOP

Related Classes of com.github.tomakehurst.wiremock.common.ProxySettings

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.