fabric8io / mockwebserver

An extension of okhttp's mockwebserver, that provides a DSL and is easier to use
Apache License 2.0
113 stars 38 forks source link

Fix the attribute selector logic #46

Closed Xcelled closed 4 years ago

Xcelled commented 4 years ago

The AttributeSet matching logic has a bug in it, introduced in #41. The use of returns in the function body meant that only the first candidate attribute was being examined, and that was used as the result for the entire method.

If the hashing worked out such that the first candidate matched, but the second didn't, matches would improperly return true.

This adds a test for that case and fixes the bug.