You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the only HTTP client that can be used is okhttp, but we use wiremock instead of MockWebServer, the canonical test library for OkHttp.
Here are some reasons to switch to okhttp MockWebServer, and I offer to rewrite everything as I already began this locally:
There are currently 3 outstanding issues on flaky tests, caused by wiremock and not possible with MockWebServer as it internally uses a semaphore to block before verifying requests
wiremock ends up using its own assertions instead of assertj, which makes a cognitive glitch writing tests
wiremock's dependency tree has too many libraries and has caused interference recently
as a part of the above, CVEs unrelated to this project will show up due to indirect wiremock deps
there are multiple comments about wiremock not supporting something, which do not apply to mockwebserver, such as multiple query params
It is common place to repeat the same thing in wiremock, as it is typical to declare the path both setting up the response and verifying the request
wiremock is slower to execute by one or two orders of magnitude and this accumulates at runtime
Here are some reasons not to switch:
folks are familiar with wiremock, as well with the problems I described
by constantly updating wiremock, you can avoid interference problems and CVE exposure
because the build is already slow, the extra time spent in wiremock will not make a huge difference except running specific tests
how MockWebServer solves racy conditions is via a blocking takeRequest. If someone adds an extra one of these, it will hang a test until they figured out the bug they created.
(like testcontainers), MockWebServer 4 depends internally on junit 4, which means there will be an indirect dep still even when tests are migrated to jupiter. This does not interfere with jupiter at runtime in any way.
Here's an example of the deps diff, note that okhttp can no longer interfere with jackson, and it has no opinion on jakarta vs javax on servlets.
Currently, the only HTTP client that can be used is okhttp, but we use wiremock instead of MockWebServer, the canonical test library for OkHttp.
Here are some reasons to switch to okhttp MockWebServer, and I offer to rewrite everything as I already began this locally:
Here are some reasons not to switch:
takeRequest
. If someone adds an extra one of these, it will hang a test until they figured out the bug they created.Here's an example of the deps diff, note that okhttp can no longer interfere with jackson, and it has no opinion on jakarta vs javax on servlets.
Here's an example diff of a test, note a couple tech debt removed.
The text was updated successfully, but these errors were encountered: