@Test void selectTest() throws Exception { final URL pacUrl = PacBasedProxyProviderTest.class.getResource("simple-pac.js"); final URI uri = new URI("http: final PacBasedProxyProvider pacBasedProxyProvider = new PacBasedProxyProvider(pacUrl, new NoopPacProxyCache()); final List<Proxy> proxies = pacBasedProxyProvider.select(uri); Assertions.assertNotNull(proxies); Assertions.assertEquals(2, proxies.size()); Assertions.assertEquals(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("proxy.example.com", 8080)), proxies.get(0)); Assertions.assertEquals(Proxy.NO_PROXY, proxies.get(1)); }
@Override public List<Proxy> select(final URI uri) { Assert.requireNonNull(uri, "uri"); final String proxiesString = pacEvaluator.getProxies(uri); final List<Proxy> proxies = PacUtils.getProxiesFromPacResult(proxiesString); LOG.debug("PAC Proxies found for '{}' : {}", uri, proxies); return Collections.unmodifiableList(proxies); }
PacBasedProxyProvider implements ProxyProvider { @Override public List<Proxy> select(final URI uri) { Assert.requireNonNull(uri, "uri"); final String proxiesString = pacEvaluator.getProxies(uri); final List<Proxy> proxies = PacUtils.getProxiesFromPacResult(proxiesString); LOG.debug("PAC Proxies found for '{}' : {}", uri, proxies); return Collections.unmodifiableList(proxies); } }
PacBasedProxyProvider implements ProxyProvider { @Override public List<Proxy> select(final URI uri) { Assert.requireNonNull(uri, "uri"); final String proxiesString = pacEvaluator.getProxies(uri); final List<Proxy> proxies = PacUtils.getProxiesFromPacResult(proxiesString); LOG.debug("PAC Proxies found for '{}' : {}", uri, proxies); return Collections.unmodifiableList(proxies); } PacBasedProxyProvider(final URL pacConfigFileUrl, final PacProxyCache cache); }
PacBasedProxyProvider implements ProxyProvider { @Override public List<Proxy> select(final URI uri) { Assert.requireNonNull(uri, "uri"); final String proxiesString = pacEvaluator.getProxies(uri); final List<Proxy> proxies = PacUtils.getProxiesFromPacResult(proxiesString); LOG.debug("PAC Proxies found for '{}' : {}", uri, proxies); return Collections.unmodifiableList(proxies); } PacBasedProxyProvider(final URL pacConfigFileUrl, final PacProxyCache cache); @Override List<Proxy> select(final URI uri); }
PacBasedProxyProvider implements ProxyProvider { @Override public List<Proxy> select(final URI uri) { Assert.requireNonNull(uri, "uri"); final String proxiesString = pacEvaluator.getProxies(uri); final List<Proxy> proxies = PacUtils.getProxiesFromPacResult(proxiesString); LOG.debug("PAC Proxies found for '{}' : {}", uri, proxies); return Collections.unmodifiableList(proxies); } PacBasedProxyProvider(final URL pacConfigFileUrl, final PacProxyCache cache); @Override List<Proxy> select(final URI uri);  }