org.springframework.test.web.client

Interface RequestMatcher

  • All Known Subinterfaces:
    RequestExpectation
    All Known Implementing Classes:
    DefaultRequestExpectation
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.


    @FunctionalInterface
    public interface RequestMatcher
    A contract for matching requests to expectations.

    See MockRestRequestMatchers for static factory methods.

    Since:
    3.2
    Author:
    Craig Walls
    • Method Detail

      • match

        void match(ClientHttpRequest request)
            throws java.io.IOException,
                   java.lang.AssertionError
        Match the given request against specific expectations.
        Parameters:
        request - the request to make assertions on
        Throws:
        java.io.IOException - in case of I/O errors
        java.lang.AssertionError - if expectations are not met