I'm trying to capture an argument using Mockito. This argument is of type List< MyClass >
. But I can't find the proper syntax to specify it.
I can do this:
ArgumentCaptor< MyClass > captor =
ArgumentCaptor.forClass( MyClass.class );
But I don't get this to compile:
ArgumentCaptor< List<MyClass> > captor =
ArgumentCaptor.forClass( List<MyClass>.class );
Is there a way?
It should work using the @Captor
annotation:
@Captor
private ArgumentCaptor<ArrayList<SomeType>> captor;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With