LukeMathWalker / wiremock-rs

HTTP mocking to test Rust applications.
Apache License 2.0
617 stars 70 forks source link

add 'with_priority()' to handle interlaced request matching conditions #80

Closed beltram closed 2 years ago

beltram commented 2 years ago

Hi @LukeMathWalker, this is something from the original Wiremock I wanted to bring in wiremock-rs for a long time.
Let me know what you think

LukeMathWalker commented 2 years ago

This looks good! I think we need to really make sure the documentation is clear though - what happens when two mocks have the same level of priority but interlacing conditions?

beltram commented 2 years ago

Indeed.
I improved tests to enlight this and documented this on the method : when 2 mocks have the same priority it fallbacks to insertion order (same behaviour as original Wiremock btw).
I was relunctant in repeating this in lib.rs because IMO this is a rather advanced usage of wiremock and could be confusing for newcomers

LukeMathWalker commented 2 years ago

Merged and released!