-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding missing equals Methods and Tests #2037
Conversation
Hi @tomakehurst, any feedback on this? Would be nice to have these features ;) |
I'm curious as to why you feel these are required on these classes. Can you share some examples of where the lack of these is a problem? |
@tomakehurst Without these methods, using hash-based, sets or sorted collections (or just |
I'm building a layer above WireMock to dynamically create Mappings at runtime via proxyMappings. Every proxied request is recorded and then transformed to the format and checks we need and dynamically saved as a mapping. To detect if a mapping already exists, I'm using equals method. Without overriding these methods, you cannot compare mappings and parts of them. |
@oleg-nenashev I understand in general what the impact of not including these methods is, but when I see people asking about them in internal classes where they're not needed for WireMock to work correctly I worry we're encouraging coupling to implementation details. Having said that I think @jnt0r has a reasonable use case in mind here so I think we should merge this. One comment about the change - I notice there are no test assertions for the |
Alright, thanks @tomakehurst. I updated the PR and added the tests for the hashCode methods. |
PR for #2034