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

org.mockserver.matchers.MatcherBuilder Maven / Gradle / Ivy

There is a newer version: 5.15.0
Show newest version
package org.mockserver.matchers;

import io.netty.handler.codec.http.QueryStringDecoder;
import org.mockserver.model.HttpRequest;

/**
 * @author jamesdbloom
 */
public class MatcherBuilder {

    public HttpRequestMatcher transformsToMatcher(HttpRequest httpRequest) {
        if (httpRequest != null) {
            return new HttpRequestMatcher()
                    .withHttpRequest(httpRequest)
                    .withMethod(httpRequest.getMethod())
                    .withURL(httpRequest.getURL())
                    .withPath(httpRequest.getPath())
                    .withQueryStringParameters(httpRequest.getQueryStringParameters())
                    .withBody(httpRequest.getBody())
                    .withHeaders(httpRequest.getHeaders())
                    .withCookies(httpRequest.getCookies());
        } else {
            return new HttpRequestMatcher();
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy