Class HttpStub

java.lang.Object
org.stubit.http.HttpStub
All Implemented Interfaces:
AutoCloseable

public class HttpStub extends Object implements AutoCloseable
A HttpStub wraps an HttpServer that is started locally on a dynamic port to serve fixed stubbed responses (Stubbings).

This can be used to simulate (stub) a remote service used in your production code. In order to do so, you need to configure your code to call the HttpStub's address instead of the actual service address.

  • Constructor Details

    • HttpStub

      public HttpStub()
      Creates and starts the HttpStub.
  • Method Details