@Test
public void testHttpsProxyDefined() throws HttpException {

    System.setProperty("https.proxyHost", "httpsProxy");
    System.setProperty("https.proxyPort", "9443");
    assertNull(ProxyAddressSelector.getProxyForUrl("http://www.jahia.com"));
    assertEquals("httpsProxy:9443", ProxyAddressSelector.getProxyForUrl("https://www.jahia.com"));
    assertNull(ProxyAddressSelector.getProxyForUrl("http://localhost:8080"));
    assertEquals("httpsProxy:9443", ProxyAddressSelector.getProxyForUrl("https://localhost:8080"));
    assertNull(ProxyAddressSelector.getProxyForUrl("www.jahia.com:9090"));
    assertNull(ProxyAddressSelector.getProxyForUrl("localhost:9090"));
    assertNull(ProxyAddressSelector.getProxyForUrl("/aaa.html"));
    System.setProperty("https.proxyPort", "");
    assertEquals("httpsProxy:443", ProxyAddressSelector.getProxyForUrl("https://www.jahia.com"));
}