Skip to content

@MockitoSpyBean behavior different from @SpyBean #43245

@tobias-lippert

Description

@tobias-lippert

Version: Spring Boot 3.4.0-RC1
Hi Spring team,

I'm not sure if this belongs to Spring Boot or Spring framework since the new annotation is part of the Spring framework but the old annotation is part of Spring Boot.
Previously, when using @SpyBean I did not have to create a bean instance in my test context to spy on it.
This is now different as stated in the docs and the blog post (https://docs.spring.io/spring-framework/reference/testing/annotations/integration-spring/annotation-mockitobean.html).
If this is intended behavior, feel free to close this issue since it is clearly documented.

Otherwise, I can create a reproducer, I think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fixstatus: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions