Closed EvanCarroll closed 3 years ago
I'm just curious to know if this also applies for wiremock. From the docs of httpmock,
Attention: This library manages a pool of MockServer instances in the background. Instead of always starting a new mock server, a MockServer instance is only created on demand if there is no free MockServer instance in the pool and the pool has not reached a maximum size yet. Otherwise, THIS METHOD WILL BLOCK the executing function until a free mock server is available.
It is true that the two crates have the same features (wiremock-rs
's can be used in standalone mode via stubrs
).
At the same time, wiremock-rs
and httpmock
have different APIs: it's a matter of taste what you prefer to use.
As you might imagine, I find wiremock-rs
's more intuitive and I prefer it. Otherwise I'd have deprecated the whole thing a long while ago :)
When it comes to pooling, check https://docs.rs/wiremock/0.5.2/wiremock/index.html#efficiency
If you are looking for an in-depth introduction to wiremock-rs
, check https://www.lpalmieri.com/posts/how-to-write-a-rest-client-in-rust-with-reqwest-and-wiremock/
I'll close this unless you have more specific questions on wiremock-rs
.
I'm curious to know why you host a comparison that shows no reason to use wiremock over the "prior art" httpmock? Is that the opinion of the developers? And if so, would it not be better to advise in big bold letters at the top of the project that it's deprecated or to officially endorse
httpmock
?Sorry this ecosystem is confusing. I'm new. What what you advise me to learn to accomplish this task on a greenfield project?
You can see the comparison outside of the docs in this blog entry,