Skip to content

Commit

Permalink
Implement toString() in TestBeanOverrideHandler
Browse files Browse the repository at this point in the history
Closes gh-34072
  • Loading branch information
sbrannen committed Dec 11, 2024
1 parent 0c68874 commit 7206b28
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.core.ResolvableType;
import org.springframework.core.style.ToStringCreator;
import org.springframework.lang.Nullable;
import org.springframework.test.context.bean.override.BeanOverrideHandler;
import org.springframework.test.context.bean.override.BeanOverrideStrategy;
Expand Down Expand Up @@ -83,4 +84,15 @@ public int hashCode() {
return this.factoryMethod.hashCode() * 29 + super.hashCode();
}

@Override
public String toString() {
return new ToStringCreator(this)
.append("field", getField())
.append("beanType", getBeanType())
.append("beanName", getBeanName())
.append("strategy", getStrategy())
.append("factoryMethod", this.factoryMethod)
.toString();
}

}

0 comments on commit 7206b28

Please sign in to comment.