Package com.github.tomakehurst.wiremock.matching

Examples of com.github.tomakehurst.wiremock.matching.ValuePattern


            }
        }

        String body = request.getBodyAsString();
        if (!body.isEmpty()) {
            ValuePattern bodyPattern = valuePatternForContentType(request);
            requestPattern.setBodyPatterns(asList(bodyPattern));
        }

        return requestPattern;
    }
View Full Code Here


                header("Content-Type", "text/xml"),
                header("Encoding", "UTF-8")));
  }

  private ValuePattern headerEqualTo(String value) {
    ValuePattern headerPattern = new ValuePattern();
    headerPattern.setEqualTo(value);
    return headerPattern;
  }
View Full Code Here

    headerPattern.setEqualTo(value);
    return headerPattern;
  }
 
  private ValuePattern headerMatches(String value) {
    ValuePattern headerPattern = new ValuePattern();
    headerPattern.setMatches(value);
    return headerPattern;
  }
View Full Code Here

    headerPattern.setMatches(value);
    return headerPattern;
  }
 
  private ValuePattern headerDoesNotMatch(String value) {
    ValuePattern headerPattern = new ValuePattern();
    headerPattern.setDoesNotMatch(value);
    return headerPattern;
  }
View Full Code Here

    private String doesNotMatch;
    private String contains;
    private String matchesJsonPath;

    public ValuePattern asValuePattern() {
    ValuePattern pattern = new ValuePattern();
    pattern.setEqualTo(equalTo);
    pattern.setEqualToJson(equalToJson);
    pattern.setEqualToXml(equalToXml);
        pattern.setMatchesXPath(matchingXPath);
        pattern.setJsonCompareMode(jsonCompareMode);
    pattern.setMatches(matches);
    pattern.setDoesNotMatch(doesNotMatch);
    pattern.setContains(contains);
        pattern.setMatchesJsonPaths(matchesJsonPath);
    return pattern;
  }
View Full Code Here

    context.checking(new Expectations() {{
      one(notifier).info("URL /for/logging is match, but header Content-Type is not. For a match, value should equal text/xml");
    }});
   
    RequestPattern requestPattern = new RequestPattern(POST, "/for/logging");
    ValuePattern headerPattern = new ValuePattern();
    headerPattern.setEqualTo("text/xml");
    requestPattern.addHeader("Content-Type", headerPattern);
   
    Request request = aRequest(context)
      .withUrl("/for/logging")
      .withMethod(POST)
View Full Code Here

TOP

Related Classes of com.github.tomakehurst.wiremock.matching.ValuePattern

Copyright © 2018 www.massapicom. 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.