Class StubbedResponse.Builder

java.lang.Object
org.stubit.http.StubbedResponse.Builder
Enclosing class:
StubbedResponse

public static class StubbedResponse.Builder extends Object
A fluent API builder for StubbedResponse.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • body

      public StubbedResponse.Builder body(String body)
      Sets the body for the response.
      Parameters:
      body - that will be used for the response
      Returns:
      this
    • header

      public StubbedResponse.Builder header(String name, String... value)
      Adds a header that will be set in the response.
      Parameters:
      name - header name
      value - header value or values
      Returns:
      this
    • statusCode

      public StubbedResponse statusCode(int statusCode)
      Sets the status code for the response and builds the StubbedResponse.
      Parameters:
      statusCode - status code that will be used in the response
      Returns:
      the built StubbedResponse