All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.dreamhead.moco.rest.RestAllSetting Maven / Gradle / Ivy

Go to download

Moco is an easy setup stub framework, mainly focusing on testing and integration.

There is a newer version: 1.5.0
Show newest version
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 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())));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy