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

com.github.dreamhead.moco.parser.model.RequestSetting 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.parser.model;

import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.dreamhead.moco.RequestMatcher;
import com.github.dreamhead.moco.parser.RequestMatcherFactory;
import com.google.common.base.MoreObjects;

import java.util.Map;

@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
public final class RequestSetting extends BaseResourceSetting {
    private final RequestMatcherFactory factory = new DynamicRequestMatcherFactory();

    private TextContainer uri;

    private TextContainer method;
    private TextContainer version;

    private Map headers;
    private Map xpaths;
    @JsonProperty("json_paths")
    private Map jsonPaths;
    private Map queries;
    private Map cookies;
    private Map forms;

    private StructSetting struct;

    protected MoreObjects.ToStringHelper toStringHelper() {
        return super.toStringHelper()
                .add("version", version)
                .add("URI", uri)
                .add("method", method)
                .add("headers", headers)
                .add("xpaths", xpaths)
                .add("json paths", jsonPaths)
                .add("queries", queries)
                .add("cookies", cookies)
                .add("forms", forms)
                .add("struct", struct);
    }

    public RequestMatcher getRequestMatcher() {
        return factory.createRequestMatcher(this);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy