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

@MockBean on feign client is not working #22229

Closed
hikaru-shindo opened this issue Jul 6, 2020 · 1 comment
Closed

@MockBean on feign client is not working #22229

hikaru-shindo opened this issue Jul 6, 2020 · 1 comment
Labels
for: external-project For an external project and not something we can fix status: duplicate A duplicate of another issue

Comments

@hikaru-shindo
Copy link

The update to 2.2.7 seems to have broken the support of MockBean for interfaces it seems.

I tried mocking a Feign client with MockBean but the real Feign client is used instead of my mock, so the test fails.

I have create a sample project showcasing the issue with springmockk (which ported this change) and mockito: https://github.com/hikaru-shindo/springmokk-mockkbean-feign-error-example

Downgrading springmockk to 2.0.1 (not part of THIS report) and Spring Boot to 2.2.6 (for mockito test) will make the tests pass.

My bug report to springmockk suggests the problematic change is in b9c2b7b.

@wilkinsona
Copy link
Member

Thanks for the report. This is a duplicate of #21379. It should have been fixed by spring-cloud/spring-cloud-openfeign#337.

@wilkinsona wilkinsona added for: external-project For an external project and not something we can fix status: duplicate A duplicate of another issue and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix status: duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants