Package code.satyagraha.gfm.support.api.WebProxyConfig

Examples of code.satyagraha.gfm.support.api.WebProxyConfig.WebProxyData


        // given
        URI uri = new URI("http://www.test");
        given(proxyService.select(uri)).willReturn(proxyDataListEmpty);

        // when
        WebProxyData webProxyData = webProxyConfig.getWebProxyData(uri);

        // then
        assertThat(webProxyData, nullValue());
    }
View Full Code Here


        given(proxyData.getPassword()).willReturn(password);
        URI uri = new URI("http://www.test");
        given(proxyService.select(uri)).willReturn(proxyDataListOne);

        // when
        WebProxyData webProxyData = webProxyConfig.getWebProxyData(uri);

        // then
        assertThat(webProxyData, notNullValue());
        URI proxyUri = new URI(webProxyData.getProxyUri());
        assertThat(proxyUri.getHost(), is(proxyHost));
        assertThat(proxyUri.getPort(), is(proxyPort));
        assertThat(webProxyData.getUserId(), is(userid));
        assertThat(webProxyData.getPassword(), is(password));
    }
View Full Code Here

        try {
            uri = new URI(endpoint);
        } catch (URISyntaxException e) {
            throw new RuntimeException(e);
        }
        WebProxyData webProxyData = webProxyConfig.getWebProxyData(uri);
        if (webProxyData != null) {
            if (webProxyData.getProxyUri() != null) {
                clientProperties.put(DefaultApacheHttpClient4Config.PROPERTY_PROXY_URI, webProxyData.getProxyUri());
                if (webProxyData.getUserId() != null) {
                    clientProperties.put(DefaultApacheHttpClient4Config.PROPERTY_PROXY_USERNAME, webProxyData.getUserId());
                    if (webProxyData.getPassword() != null) {
                        clientProperties.put(DefaultApacheHttpClient4Config.PROPERTY_PROXY_PASSWORD, webProxyData.getPassword());
                    }
                }
            }
        }
View Full Code Here

TOP

Related Classes of code.satyagraha.gfm.support.api.WebProxyConfig.WebProxyData

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.