chore(deps): update rust crate mockito to 0.32 (1.x) #12210
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.31
->0.32
Release Notes
lipanski/mockito (mockito)
v0.32.5
Compare Source
Arc
(more reliable in this case)v0.32.4
Compare Source
Mock::with_body_from_request
which allows setting the response body dynamically, based on theRequest
objectMutex
with anRwLock
v0.32.3
Compare Source
Server::new
andServer::new_async
now return aServerGuard
object which dereferences toServer
- this is only relevant if you need to assign a type to your serverv0.32.2
Compare Source
_async
methodsv0.32.1
Compare Source
v0.32.0
Compare Source
This is a major re-write, introducing a bunch of long awaited features:
[Breaking] The minimum supported Rust version was bumped to 1.65.0
Tests can now run in parallel as long as you use the new
mockito::Server
API:You can run multiple servers/hosts at the same time:
Support for HTTP2
An async interface for all actions (though the sync interface is also available):
The backend has been rewritten to use Hyper
This version will be backwards compatible with the previous version, but deprecation warnings have been introduced and you are encouraged to migrate, since the old API still requires running tests sequentially. Migrating to the new API is quite straighforward:
Migrating to the new API
Legacy API:
New API:
Migrating to the async API
In order to write async tests, you'll need to use the
_async
methods:Server::new_async
Mock::create_async
Mock::assert_async
Mock::matched_async
Server::reset_async
...otherwise your tests will not compile and you'll see this error:
Cannot start a runtime from within a runtime
.When using tokio, prefer the single-threaded runtime over the multi-threaded one.
Example:
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.