You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I upgraded from 2.2.5 to 2.3.0. We have a @SpringBootTest that uses @MockBean on a @FeignClient. With 2.2.5, we were able to Mockito.when(...) to make the FeignClient return what we wanted in that specific test. After upgrading to 2.3.0, the @MockBean doesn't seem to work correctly: In debug mode I can see that in the test, we indeed have a Mockito mock for the client, in the tested code however it's not a mock but Spring's proxy thus crashing the test. The behaviour can be seen here https://github.com/N4zroth/spring-boot-feign-mockbean , the test fails with 2.3.0 but succeeds with 2.2.5.
I'm quite sure that the previous behavior was correct and the new one is wrong. Correct me if I'm wrong, though.
The text was updated successfully, but these errors were encountered:
I upgraded from 2.2.5 to 2.3.0. We have a @SpringBootTest that uses @MockBean on a @FeignClient. With 2.2.5, we were able to Mockito.when(...) to make the FeignClient return what we wanted in that specific test. After upgrading to 2.3.0, the @MockBean doesn't seem to work correctly: In debug mode I can see that in the test, we indeed have a Mockito mock for the client, in the tested code however it's not a mock but Spring's proxy thus crashing the test. The behaviour can be seen here https://github.com/N4zroth/spring-boot-feign-mockbean , the test fails with 2.3.0 but succeeds with 2.2.5.
I'm quite sure that the previous behavior was correct and the new one is wrong. Correct me if I'm wrong, though.
The text was updated successfully, but these errors were encountered: