Skip to content

OverrideMetadata equals/hashCode should rely on getClass() #33005

@snicoll

Description

@snicoll

equals and hashCode implementations in MockitoSpyBeanOverrideMetadata care about getClass() but shouldn't:

}
// For SpyBean we want the class to be exactly the same.
if (other == null || other.getClass() != getClass()) {
return false;
}

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions