com.github.dreamhead.moco.handler.ProxyResponseHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of moco-core Show documentation
Show all versions of moco-core Show documentation
Moco is an easy setup stub framework, mainly focusing on testing and integration.
package com.github.dreamhead.moco.handler;
import com.github.dreamhead.moco.ResponseHandler;
import com.github.dreamhead.moco.handler.failover.Failover;
import com.google.common.base.Optional;
import java.net.URL;
import static com.google.common.base.Optional.of;
public class ProxyResponseHandler extends AbstractProxyResponseHandler implements ResponseHandler {
private final URL url;
public ProxyResponseHandler(final URL url, final Failover failover) {
super(failover);
this.url = url;
}
@Override
protected Optional remoteUrl(final String uri) {
return of(this.url.toString());
}
}