Class Routes

java.lang.Object
kong.unirest.core.Routes
All Implemented Interfaces:
Assert

class Routes extends Object implements Assert
  • Field Details

  • Constructor Details

  • Method Details

    • newExpectation

      Expectation newExpectation()
    • matches

      boolean matches(HttpRequest request)
    • exchange

      RawResponse exchange(HttpRequest request, Config config)
    • matches

      boolean matches(HttpMethod httpMethod, Path url)
    • getBestMatch

      private Optional<Invocation> getBestMatch(HttpRequest request)
    • getBestMatch

      private Optional<Invocation> getBestMatch(HttpRequest request, boolean expected)
    • hadHeader

      public Assert hadHeader(String key, 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(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(String name, 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 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
    • getMethod

      HttpMethod getMethod()
    • getPath

      String getPath()
    • addInvoke

      void addInvoke(Invocation invocation)