
org.mockserver.matchers.MatcherBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockserver-core Show documentation
Show all versions of mockserver-core Show documentation
Functionality used by all MockServer modules for matching and expectations
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