Skip to content
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

Remove proxyTargetAware attribute from @MockitoSpyBean #33775

Closed
sbrannen opened this issue Oct 23, 2024 · 0 comments
Closed

Remove proxyTargetAware attribute from @MockitoSpyBean #33775

sbrannen opened this issue Oct 23, 2024 · 0 comments
Assignees
Labels
in: test Issues in the test module type: enhancement A general enhancement
Milestone

Comments

@sbrannen
Copy link
Member

Overview

During my recent analysis of our @MockitoSpyBean support, it became apparent that we do not need the proxyTargetAware attribute.

The proxyTargetAware attribute was originally introduced in Spring Boot's @SpyBean support in order to address spring-projects/spring-boot#5837; however, Spring Framework's @MockitoSpyBean support works differently and does not modify existing Spring AOP advice chains. In other words, setting that flag to true does not make anything "proxy target aware". In addition, we are not aware of any compelling use cases for which one would want to set that flag to false.

In light of the above, we should remove the proxyTargetAware attribute from @MockitoSpyBean while keeping the underlying feature in tact (i.e., transparent verification for spies created via @MockitoSpyBean), which was the behavior when proxyTargetAware was set to true (the default value for the attribute).

Related Issues

@sbrannen sbrannen added in: test Issues in the test module type: enhancement A general enhancement labels Oct 23, 2024
@sbrannen sbrannen added this to the 6.2.0-RC3 milestone Oct 23, 2024
@sbrannen sbrannen self-assigned this Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test Issues in the test module type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant