org.sonatype.tests.http.server.fluent
Class Proxy
java.lang.Object
org.sonatype.tests.http.server.fluent.Server
org.sonatype.tests.http.server.fluent.Proxy
public class Proxy
- extends Server
This is not a real proxy. It supports proxy connections and auth, but will not forward requests to the requested URL.
It will resolve the requested path against the behaviors set for the proxy instance.
Example:
Server proxy = Proxy.withPort(0).start();
proxy.serve( "/*" ).withBehaviours( redirect( "/other/url" ) );
proxy.serve( "/other/*" ).withBehaviours( content( "test" ) );
setProxy("localhost", proxy.getPort() );
assertThat( get( "http://invalid.url/foo" ), is ( "test" ) );
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Proxy
public Proxy(JettyProxyProvider serverProvider)
withPort
public static Server withPort(int port)
throws Exception
- Throws:
Exception
Copyright © 2010-2013 Sonatype, Inc.. All Rights Reserved.