-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Behavior changed of MockBean in 2.2.7 #21379
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
Comments
Thanks for the sample. The change in behaviour is a side-effect of the fix for #20665. Unfortunately, Given that Flagging for team attention to see if we can think of anything better. |
I think we're pretty much stuck on our side, but the Spring Cloud team might be able to help us. They could update |
I've raise spring-cloud/spring-cloud-openfeign#337 |
Thanks, @philwebb. I should have remembered that, particularly as it was me that added it… |
I'm afraid there's nothing we can change in Spring Boot that will fix this without breaking the other issue. We'll leave this one for Spring Cloud to fix. |
Ok thank for the support :) |
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 beforeHere is a small project with an example : https://gitlab.com/GuanacoBE/feignmockbean
The text was updated successfully, but these errors were encountered: