Skip to content

@TestConfiguration disables proxying of @Bean methods #18653

@agebhar1

Description

@agebhar1

After upgrade to Spring Boot v2.2 the test configuration class which is annotated with @TestConfiguration is not proxied by CGLIB anymore, thus calling @Bean methods return new instances every time.

After quick search in Spring Framework cores changes gives a hint:

[...] or not finding annotations anymore where they have previously been found accidentally.

The corresponding commit in Spring Framework.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: supersededAn issue that has been superseded by anothertype: bugA general bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions