View Javadoc

1   package com.atlassian.httpclient.apache.httpcomponents.proxy;
2   
3   import com.atlassian.httpclient.api.factory.Scheme;
4   import org.junit.Rule;
5   import org.junit.contrib.java.lang.system.ClearSystemProperties;
6   
7   import static com.atlassian.httpclient.apache.httpcomponents.proxy.ProxyTestUtils.getProxyPropertiesNames;
8   
9   public class NoProxyHostsSystemPropertiesTest extends NoProxyHostsTestBase {
10      @Rule
11      public ClearSystemProperties clearSystemPropertiesRule =
12              new ClearSystemProperties(getProxyPropertiesNames());
13  
14      @Override
15      protected SystemPropertiesProxyConfig newProxyConfig() {
16          return new SystemPropertiesProxyConfig();
17      }
18  
19      @Override
20      protected void setProxyDetails(String proxyHost, int proxyPort, String nonProxyHosts) {
21          System.setProperty(scheme.schemeName() + ".proxyHost", proxyHost);
22          System.setProperty(scheme.schemeName() + ".proxyPort", Integer.toString(proxyPort));
23          System.setProperty("http.nonProxyHosts", nonProxyHosts);
24      }
25  }