> 2. Creating an an adapter-style interface in your test code that
> implements both SomeProxy & BindingProvider
Is there a reason why Mockito doesn't allow to create a mock
implementing multiple interfaces?
The ClassImposterizer used by Mockito in MockUtil.createMock() already
allows it.
Kind regards,
Kris Vandebroek
mock(Foo.class, withSettings().extraInterfaces(Bar.class));
As regards the rationale for needing it, I encountered a test scenario where I wouldn't have succeeded without this feature. I had Servlet code that was testing the implementation of a Filter:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain){ HttpServletRequest hrequest = (HttpServletRequest) request; HttpServletResponse hresponse = (HttpServletResponse) response;