Examples of MatchesRegex


Examples of com.github.restdriver.matchers.MatchesRegex

     * Constructor taking Pattern.
     *
     * @param path The mandatory argument is the path which will be listened on
     */
    public ClientDriverRequest(Pattern path) {
        this(new MatchesRegex(path));
    }
View Full Code Here

Examples of com.github.restdriver.matchers.MatchesRegex

     * @param key The key from ?key=value
     * @param value The value from ?key=value in the form of a Pattern
     * @return the object you called the method on, so you can chain these calls.
     */
    public ClientDriverRequest withParam(String key, Pattern value) {
        params.put(key, new MatchesRegex(value));
        return this;
    }
View Full Code Here

Examples of com.github.restdriver.matchers.MatchesRegex

    public ClientDriverRequest withParams(Map<String, Object> newParams) {
        for (Entry<String, Object> entry : newParams.entrySet()) {
            String key = entry.getKey();
            Object value = entry.getValue();
            if (value instanceof Pattern) {
                this.params.put(key, new MatchesRegex((Pattern) value));
            } else {
                this.params.put(key, new IsEqual<String>(value.toString()));
            }
        }
        return this;
View Full Code Here

Examples of com.github.restdriver.matchers.MatchesRegex

     * @param contentType eg "text/plain"
     * @return the object you called the method on, so you can chain these calls.
     */
    public ClientDriverRequest withBody(String withBodyContent, Pattern contentType) {
        bodyContentMatcher = new IsEqual<String>(withBodyContent);
        bodyContentType = new MatchesRegex(contentType);
        return this;
    }
View Full Code Here

Examples of com.github.restdriver.matchers.MatchesRegex

     * @param withBodyContent the bodyContent to set
     * @param contentType eg "text/plain"
     * @return the object you called the method on, so you can chain these calls.
     */
    public ClientDriverRequest withBody(Pattern withBodyContent, String contentType) {
        bodyContentMatcher = new MatchesRegex(withBodyContent);
        bodyContentType = new IsEqual<String>(contentType);
        return this;
    }
View Full Code Here

Examples of com.github.restdriver.matchers.MatchesRegex

     * @param withBodyContent the bodyContent to set
     * @param contentType eg "text/plain"
     * @return the object you called the method on, so you can chain these calls.
     */
    public ClientDriverRequest withBody(Pattern withBodyContent, Pattern contentType) {
        bodyContentMatcher = new MatchesRegex(withBodyContent);
        bodyContentType = new MatchesRegex(contentType);
        return this;
    }
View Full Code Here

Examples of com.github.restdriver.matchers.MatchesRegex

     * @param withHeaderName the headerName to match on
     * @param withHeaderValue the headerValue to match on
     * @return the object you called the method on, so you can chain these calls
     */
    public ClientDriverRequest withHeader(String withHeaderName, Pattern withHeaderValue) {
        return withHeader(withHeaderName, new MatchesRegex(withHeaderValue));
    }
View Full Code Here

Examples of com.github.restdriver.matchers.MatchesRegex

    public ClientDriverRequest withHeaders(Map<String, Object> headers) {
        for (Entry<String, Object> entry : headers.entrySet()) {
            String headerName = entry.getKey();
            Object headerValue = entry.getValue();
            if (headerValue instanceof Pattern) {
                withHeader(headerName, new MatchesRegex((Pattern) headerValue));
            } else {
                withHeader(headerName, new IsEqual<String>(headerValue.toString()));
            }
        }
        return this;
View Full Code Here

Examples of com.github.restdriver.matchers.MatchesRegex

   
    private Matchers() {
    }
   
    public static MatchesRegex matchingRegex(String pattern) {
        return new MatchesRegex(Pattern.compile(pattern));
    }
View Full Code Here

Examples of com.github.restdriver.matchers.MatchesRegex

    public static MatchesRegex matchingRegex(String pattern) {
        return new MatchesRegex(Pattern.compile(pattern));
    }
   
    public static MatchesRegex matchingRegex(Pattern pattern) {
        return new MatchesRegex(pattern);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.