Class Routes

  • All Implemented Interfaces:
    Assert

    class Routes
    extends java.lang.Object
    implements Assert
    • Field Detail

      • path

        private final java.lang.String path
      • invokes

        private final java.util.List<Invocation> invokes
    • Method Detail

      • getBestMatch

        private java.util.Optional<Invocation> getBestMatch​(HttpRequest request,
                                                            boolean expected)
      • hadHeader

        public Assert hadHeader​(java.lang.String key,
                                java.lang.String value)
        Description copied from interface: Assert
        Assert that any request to this method/path contained this header
        Specified by:
        hadHeader in interface Assert
        Parameters:
        key - the expected header key
        value - the expected header value
        Returns:
        this Assert instance
      • hadBody

        public Assert hadBody​(java.lang.String expected)
        Description copied from interface: Assert
        Assert that any the request sent this body. this only applies to non-multipart requests.
        Specified by:
        hadBody in interface Assert
        Parameters:
        expected - the expected body
        Returns:
        this Assert instance
      • hadField

        public Assert hadField​(java.lang.String name,
                               java.lang.String value)
        Description copied from interface: Assert
        Assert that any the request sent a multipart field
        Specified by:
        hadField in interface Assert
        Parameters:
        name - the field name
        value - the field value
        Returns:
        this Assert instance
      • allHeaders

        private Headers allHeaders()
      • wasInvokedTimes

        public Assert wasInvokedTimes​(int i)
        Description copied from interface: Assert
        assert that this instance of method/path was invoked x times
        Specified by:
        wasInvokedTimes in interface Assert
        Parameters:
        i - the number of times invoked.
        Returns:
        this Assert instance
      • sumInvokes

        private java.lang.Integer sumInvokes()
      • verifyAll

        public Assert verifyAll()
        Description copied from interface: Assert
        verify that all Expectations were fulfilled at least once.
        Specified by:
        verifyAll in interface Assert
        Returns:
        this Assert instance
      • getPath

        java.lang.String getPath()
      • addInvoke

        void addInvoke​(Invocation invocation)