ssacher-tgm / mockito

Automatically exported from code.google.com/p/mockito
0 stars 0 forks source link

Specify extra interface through @Mock annotation #193

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm using Mockito to test some components, which interact with classes that 
implement Portlet and the EventPortlet interface.
In my test I need to create mock objects for that.
I used to create my mock with the @Mock annotation, but I can't use that to 
create mocks with extra interfaces.

I switched to using
Portlet mockPortlet = Mockito.mock(EventPortlet.class, 
withSettings().extraInterfaces(Portlet.class));

I would like to able to do something like this:
@Mock(extraInterfaces(Portlet.class))
private EventPortlet mockPortlet.

Original issue reported on code.google.com by mcbee...@gmail.com on 28 May 2010 at 1:20

GoogleCodeExporter commented 8 years ago

Original comment by szcze...@gmail.com on 30 May 2010 at 6:21

GoogleCodeExporter commented 8 years ago

Original comment by szcze...@gmail.com on 3 Aug 2011 at 5:18

GoogleCodeExporter commented 8 years ago

Original comment by szcze...@gmail.com on 3 Aug 2011 at 5:18