- A new MockServer::reset method was added that resets a mock server. Thanks for providing the pull request for this feature, @dax.
-
BREAKING CHANGES:
- For connecting to remote
httpmockservers during tests using any of theconnectmethods like MockServer::connect, MockServer::connect_async, MockServer::connect_from_env, or MockServer::connect_from_env_async, you must now activate theremotefeature. This feature is not enabled by default.
- For connecting to remote
-
Improvements:
- The dependency tree has been significantly slimmed down when the
remotefeature is not enabled. - If the new
remotefeature is not enabled,httpmockno longer has a dependency on a real HTTP client. As a result, certain TLS issues previously reported by users should no longer arise.
- The dependency tree has been significantly slimmed down when the
-
This release also updates all dependencies to the most recent version.
-
The minimum Rust version has been bumped to 1.70.
- This is a maintenance release that updates all dependencies to the most recent version.
- Fixes some dependency issues with the Docker image.
- This is a maintenance release that updates all dependencies to the most recent version.
- Extended some API methods to allow for more type flexibility (see httpmock#58). Thanks to @95th for providing the PR!
- Fixed parsing query parameter values that contain
+to represent space (see httpmock#56). Thanks to @95th for providing the PR! - Added a new Cargo feature
cookieto shorten compile time (see httpmock#63). Thanks to mythmon for providing this PR!
- Fixes a race condition that could occur when deleting mocks from the mock server (see httpmock#53).
- Replaced internal diff library (switched from
differencetosimilar, see httpmock#55).
- Fixed minimum Rust version in README (raised from 1.47 to 1.54, see release 0.6.3 for more information).
- This is a maintenance release that updates all dependencies to the most recent version.
- Bumped minimum Rust version to 1.54 due to transitive dependency.
- A bug was fixed that has unexported the When and Then structures. Both types are now exported again. Please refer to httpmock#47 for more info.
- This is a maintenance release that updates all dependencies to the most recent version.
- Old Mock structure based API was deprecated starting from version 0.5.0 and was removed with this version. Please switch to the new API based on the When / Then structures.
- The two methods
MockRef::times_calledandMockRef::times_called_asyncwere deprecated since version 0.5.0 and have now been removed. - A prelude module was added to shorten imports
that are usually required when using
httpmockin tests. - The struct
MockRefhas been renamed toMock. - Trait
MockRefExthas been renamed toMockExt. - Added support for x-www-form-urlencoded request bodies.
- Standalone server now has a request history limit that can be adjusted.
- All standalone servers parameters now have an environment variable fallback.
- Standalone servers
exposedanddisable_access_logparameters were changed, so that they now require a value in addition to the flag itself (this is due to a limitation ofstructopt/clap): Before:httpmock --expose, Now:httpmock --expose true.
- A bug has been fixed that prevented to use the mock server for requests containing a
multipart/form-datarequest body with binary data.
- Added static mock support based on YAML files for standalone mode.
- Dockerfile Rust version has been fixed.
- Documentation on query parameters has been enhanced.
- Bumped minimum Rust version to 1.46 due to transitive dependency.
- A bug has been fixed that caused false positive warnings in the log output.
- Updated all dependencies to the most recent versions.
- Assertion error messages (
MockRef::assertandMockRef::assert_hits) now contain more details.
- A bug has been fixed that prevented to use a request body in DELETE requests.
- A new extension trait
MockRefExtwas added that extends theMockRefstructure with additional but usually not required functionality.
- This is a maintenance release that updates all dependencies to the most recent version.
- This release bumps the minimal Rust version from 1.43+ to 1.45+.
- Updated dependencies to newest version.
- Removed dependency version fixation from v0.5.1.
Mock::return_body_from_fileandThen::body_from_filenow accept absolute and relative file paths.
- Updated dependency to futures-util to fix compile errors.
- Fixed all dependency version numbers to avoid future problems with new dependency version releases.
- ❌ Breaking Change: Function
Mock::expect_json_bodywas renamed toexpect_json_body_obj. - ❌ Breaking Change: Function
Mock::return_json_bodywas renamed toreturn_json_body_obj. - 🚀 Attention: A new API for mock definition was added. The old API is still available and functional, but is deprecated from now on. Please consider switching to the new API.
- 🚀 Attention: The following new assertion functions have been added that will provide you smart and helpful
error output to support debugging:
MockRef::assertMockRef::assert_hitsMockRef::assert_asyncMockRef::assert_hits_async
- The two methods
MockRef::times_calledandMockRef::times_called_asyncare now deprecated. Consider usingMockRef::hitsandMockRef::hits_async. - The two methods
Mock::return_bodyandThen::bodynow accept binary content. - The following new methods accept a
serde_json::Value:Mock::expect_json_bodyMock::return_json_bodyWhen::json_bodyThen::json_body
- 🔥 Improved documentation (a lot!).
- 👏 Debug log output is now pretty printed!
- 🍪 Cookie matching support.
- Support for convenient temporary and permanent redirect.
- The log level of some log messages was changed from
debugtotraceto make debugging easier.
- Improved documentation.
- Added a new function
base_urlto theMockServerstructure.