WireMock is a great tool to stub endpoints.
This module wraps WireMock and provides a template for stubbing endpoints.
To run use:
sbt runHttpStub
.stubCorsEnabled(true)
Automatic sending of CORS headers on stub responses..notifier(new Slf4jNotifier(true))
Use SLF4 for logging. (WireMock wraps all logging in its ownNotifier
interface).extensions(new ResponseTemplateTransformer(false))
Enable attributes of the request to be used in generating the response.
For a stub that can cache data please see DynaMockService
.
This module is a base for creating scripts to call http endpoints.
To run the tests you need http-stub
running.