com.github.dreamhead.moco.rest.RestAllSetting 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.rest;
import com.github.dreamhead.moco.HttpMethod;
import com.github.dreamhead.moco.RequestMatcher;
import com.github.dreamhead.moco.ResponseHandler;
import com.github.dreamhead.moco.RestIdMatcher;
import com.google.common.base.Optional;
import static com.github.dreamhead.moco.Moco.by;
import static com.github.dreamhead.moco.Moco.uri;
import static com.github.dreamhead.moco.util.URLs.resourceRoot;
public final class RestAllSetting extends SimpleRestSetting {
public RestAllSetting(final HttpMethod method,
final Optional matcher,
final ResponseHandler handler) {
super(method, matcher, handler);
}
@Override
protected RequestMatcher getBaseRequestMatcher(final RestIdMatcher resourceName) {
return by(uri(resourceRoot(resourceName.resourceUri())));
}
}