use of org.sonatype.jettytestsuite.ProxyServer in project tycho by eclipse.
the class ProxySupportTest method startHttpProxyServer.
private void startHttpProxyServer(boolean useAuthentication, String user, String password) throws Exception {
proxyServer = new ProxyServer();
proxyPort = findFreePort();
proxyServer.setPort(proxyPort);
proxyServer.initialize();
Map<String, String> authMap = new HashMap<>();
if (useAuthentication) {
authMap.put(user, password);
}
proxyServlet = proxyServer.getProxyServlet();
proxyServlet.setAuthentications(authMap);
proxyServlet.setUseAuthentication(useAuthentication);
proxyServer.start();
}
Aggregations