Open l0co opened 3 years ago
Please note that this works when I change ReplacingBean
to replace concrete class, not an interface:
@Singleton @Replaces(MyBean.class)
public class ReplacingBean implements IMyBean {
}
However, I can't do that in the project because there's no such class, because IMyBean
is a @Client
:
@Client
public interface IMyBean {
// ...
}
Please also note, that the above construction worked in 2.1.4
, so it seems to be possible.
I'm running into exactly this scenario as well when mocking a @Client
using Mockito. @MockBean
didn't work on interfaces, so we generally created concrete classes with @Replaces
and then used a @MockBean
to replace those concrete classes with a Mockito mock. Mocking a @Client
is a very frequent test case for us.
This was working in 2.1.2 but no longer works in 2.2.3.
Broken in
2.2.1
, works in2.1.4
.I have following beans and tests:
In
2.2.1
this results in:Reproducible example is here