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

When using @MockBean and @SpyBean make it easier to inject any underlying proxy target as well as the mock or spy #22742

Open
wilkinsona opened this issue Aug 5, 2020 · 4 comments
Labels
status: pending-design-work Needs design work before any code can be developed type: enhancement A general enhancement

Comments

@wilkinsona
Copy link
Member

We'd like to support something like this:

@SpyBean
ProxiedBean<Service> service;

ProxiedBean would then provide accessors for the bean both with and without all of its Spring proxies. This should make it easier to bypass any caching or advice when, for example, setting expectations, while having them in place when exercising the service. Hopefully this will address #22281 by providing a nicer API that can be used in place of AopTestUtils.getTargetObject(service).

@wilkinsona wilkinsona added the type: enhancement A general enhancement label Aug 5, 2020
@wilkinsona wilkinsona added this to the 2.4.x milestone Aug 5, 2020
@wilkinsona wilkinsona changed the title When using @MockBean and @SpyBean make it easy to inject any underlying proxy target as well as the mock or spy When using @MockBean and @SpyBean make it easier to inject any underlying proxy target as well as the mock or spy Aug 5, 2020
@philwebb philwebb added the status: pending-design-work Needs design work before any code can be developed label Oct 19, 2020
@philwebb philwebb modified the milestones: 2.4.x, 2.5.x Oct 19, 2020
@philwebb philwebb modified the milestones: 2.5.x, 2.6.x Mar 19, 2021
@philwebb philwebb modified the milestones: 2.6.x, 2.x Aug 23, 2021
@kriegaex

This comment has been minimized.

@wilkinsona

This comment has been minimized.

@kriegaex

This comment has been minimized.

@wilkinsona

This comment has been minimized.

@philwebb philwebb modified the milestones: 2.x, General Backlog Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: pending-design-work Needs design work before any code can be developed type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants