Class RequestMatcher<T>

    • Field Detail

      • pred

        protected final org.hamcrest.Matcher<? super T> pred
    • Constructor Detail

      • RequestMatcher

        protected RequestMatcher​(org.hamcrest.Matcher<? super T> pred)
        Parameters:
        pred - predicate to be applied on the value retrieved from the given request (cannot be null)
    • Method Detail

      • describeMismatch

        public void describeMismatch​(Object item,
                                     org.hamcrest.Description description)
        Specified by:
        describeMismatch in interface org.hamcrest.Matcher<T>
        Overrides:
        describeMismatch in class org.hamcrest.BaseMatcher<Request>
      • describeTo

        public void describeTo​(org.hamcrest.Description description)
      • retrieveValue

        protected abstract T retrieveValue​(Request req)
                                    throws Exception
        Reads a value of the given request object (the value can be anything retrievable from the request object: method, header, body,...).
        Parameters:
        req - request object to read a value from
        Returns:
        a value retrieved from the given request object.
        Throws:
        Exception - when something goes wrong. This exception will be handler correctly by Jadler.
      • provideDescription

        protected abstract String provideDescription()

        Provides a description of this matcher in form of a string consisting of "noun verb", where noun describes the value retrieved using retrieveValue(net.jadler.Request) and verb is usually a correct form of to be.

        If the retrieveValue(net.jadler.Request) provided a request method, this method would return method is string for example.

        Returns:
        matcher description