-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support @Captor injection in JUnit 5 method parameters #1382
Comments
Is there any update on this issue? It would be very handy to write following with Junit 5: @Test
void test( @Mock ClassToMock mock, @Captor ArgumentCaptor<String> argument )
{
verify( mock ).doStuff( argument.capture() );
} Unfortunately, this does not work because |
Feel free to open a PR to implement this feature. |
Also please note this prior discussion on this feature which ideally requires some fixes in JUnit5: junit-team/junit5#1604 |
Hi @TimvdLippe. |
Yes that is okay. Feel free to send us a PR! |
Fixes #1382 Co-authored-by: yevhen lazhyntsev <yevhen.lazhyntsev@hulu.com>
There is already an open PR #1350 that proposes and adds support for
@Mock
. This issue is to extend on that PR if / when it gets merged to also support the@Captor
annotation in method parameters. This would allow to inject method specific genericArgumentCaptor
that can't be caught withArgumentCaptor.of(Class)
.The text was updated successfully, but these errors were encountered: