You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to have an example of the syntax for using Argument Captors in Mockito-Kotlin. I got caught out because I used argumentCaptor.capture() instead of capture(argumentCaptor).
Here is an example of what it could be.
Argument Captors
These overcome the issue that Mockito ArgumentCaptor.capture() returns null, which results in an IllegalStateException in Kotlin.
Kotlin:
val argumentCaptor = argumentCaptor<String>()
myClass.doSomething()
verify(classToMock).sendString(capture(argumentCaptor))
I can raise this as a pull request if helpful. I would suggest adding it below the Argument Matchers section.
The text was updated successfully, but these errors were encountered:
It would be nice to have an example of the syntax for using Argument Captors in Mockito-Kotlin. I got caught out because I used
argumentCaptor.capture()
instead ofcapture(argumentCaptor)
.Here is an example of what it could be.
Argument Captors
These overcome the issue that Mockito
ArgumentCaptor.capture()
returns null, which results in anIllegalStateException
in Kotlin.Kotlin:
I can raise this as a pull request if helpful. I would suggest adding it below the Argument Matchers section.
The text was updated successfully, but these errors were encountered: