HttpMocker is a simple HTTP mocking library written in Kotlin to quickly and easily handle offline modes in your apps
Bug fixes: Fixed generated scenarios with a request body (invalid regex) #94 Fixed race condition on dynamic mocks #101
API Changes:
Updated to Kotlin 1.4.10 and OkHttp 4.0.0 (major)
Updated other dependencies (minor): Jackson (2.11.2), Moshi(1.11.0) and Kotlinx serialization (stable 1.0.0)
Changed RequestCallback
to functional interface (thanks to Kotlin 1.4) and renamed its method to processRequest
General clean up of code:
Support for multiple static filing policies Allow to specify a naming policy for recording (could be different from the one for mocks if desired)
Bug fixs:
Support for XML scenario files Fixed bug when computing response file extensions
Allow dynamic mocks to throw exceptions. Support of exceptions instead of HTTP responses in static mocks. Correction of custom JSON parser (incorrect parsing of lists or objects due to extra whitespaces).
Support exact match of requests (headers and parameters defined in the mock must match exactly, not be a subset of the request data) Allow to fail if an error occurs while recording (helps setting up the lib and detect why current configuration may fail) Allow to check absence of header or query parameter to match a request
Better naming for URL that end with a / Updated demo app Checks URL protocol when matching requests Method renaming in the Mapper interface.
Added support for Kotlinx serialization
First release: Implements a OkHttpInterceptor that answers http requests with predefined static scenarios stored as JSON files.
Added support for several JSON parsing libraries:
Fixed bug with custom serialization of null fields