Open GoogleCodeExporter opened 9 years ago
the supress is bad. i have also tried with :
suppress(constructor(CollaboratorToBeMocked.class,
InjectedIntoCollaborator.class));
Original comment by Alexandr...@gmail.com
on 11 Feb 2011 at 8:56
i took another look at things (my test class was bad).
updated the whenNew and added the supress. the supress line seems to throw the
exception
suppress(constructor(CollaboratorToBeMocked.class,
InjectedIntoCollaborator.class));
whenNew(CollaboratorToBeMocked.class).withArguments(InjectedAsTypeIntoCollaborat
or.class).thenReturn(mockedCollaborator);
Original comment by Alexandr...@gmail.com
on 11 Feb 2011 at 9:35
I haven't tried it but I think that in cases like these you can do:
Constructor ctor =
CollaboratorToBeMocked.class.getConstructor(InjectedIntoCollaborator.class);
whenNew(ctor).withArguments(InjectedIntoCollaborator.class).thenReturn(...);
Try and see if that works for you.
Original comment by johan.ha...@gmail.com
on 16 Feb 2011 at 7:24
Original issue reported on code.google.com by
Alexandr...@gmail.com
on 10 Feb 2011 at 4:22