Skip to content

Behavior changed of MockBean in 2.2.7 #21379

Closed
@JBertaux

Description

@JBertaux

Hello,

After upgrading from 2.2.6 to 2.2.7, the behavior of MockBean has changed.

One of my tests is failing, I mock a Feign Client with @MockBean and now with the new version I have two beans for the Feign Client in the context: the mock one (MyClient$MockitoMock$...) and I assume the real one with a strange type (HardCodedTarget(type=MyClient, name=my-client, url=...)).
If I give the full reference of my client in the name of the MockBean @MockBean(name = "com.MyClient"), it works as before

Here is a small project with an example : https://gitlab.com/GuanacoBE/feignmockbean

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions