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
// For SpyBean we want the class to be exactly the same.
if (other == null || other.getClass() != getClass()) {
returnfalse;
}
This looks like a copy/paste from the Spring Boot implementation that doesn't have the notion of BeanOverrideStrategy that is enough already to differentiate between those two.
The text was updated successfully, but these errors were encountered:
Looking a bit more after having removed that code, it turns out things are working but could stop if someone created an OverrideMetadata with the same settings in a different class. For instance something similar to TestBeanOverrideMetadata but with a completely different approach to how the override is created. While very unlikely, harmonizing equals/hashCode so that the OverrideMetadata implementation is part of the key sounds sensible.
snicoll
changed the title
MockitoSpyBeanOverrideMetadata equals/hashCode should not care about getClass()
OverrideMetadata equals/hashCode should rely on getClass()
Jun 11, 2024
equals and hashCode implementations in
MockitoSpyBeanOverrideMetadata
care aboutgetClass()
but shouldn't:spring-framework/spring-test/src/main/java/org/springframework/test/context/bean/override/mockito/MockitoSpyBeanOverrideMetadata.java
Lines 105 to 109 in 28f62ab
This looks like a copy/paste from the Spring Boot implementation that doesn't have the notion of
BeanOverrideStrategy
that is enough already to differentiate between those two.The text was updated successfully, but these errors were encountered: