fabric8io / mockwebserver

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

Fix the attribute selector logic #46

Closed Xcelled closed 5 years ago

Xcelled commented 5 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.