Package org.springframework.test.web.client

Examples of org.springframework.test.web.client.RequestMatcher


  /**
   * Assert request header values with the given Hamcrest matcher.
   */
  @SuppressWarnings("unchecked")
  public static RequestMatcher header(final String name, final Matcher<? super String>... matchers) {
    return new RequestMatcher() {
      @Override
      public void match(ClientHttpRequest request) {
        assertHeaderValueCount(name, request.getHeaders(), matchers.length);
        for (int i = 0 ; i < matchers.length; i++) {
          assertThat("Request header", request.getHeaders().get(name).get(i), matchers[i]);
View Full Code Here


  /**
   * Assert request header values.
   */
  public static RequestMatcher header(final String name, final String... expectedValues) {
    return new RequestMatcher() {
      @Override
      public void match(ClientHttpRequest request) {
        assertHeaderValueCount(name, request.getHeaders(), expectedValues.length);
        for (int i = 0 ; i < expectedValues.length; i++) {
          assertEquals("Request header + [" + name + "]",
View Full Code Here

TOP

Related Classes of org.springframework.test.web.client.RequestMatcher

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.