-
Notifications
You must be signed in to change notification settings - Fork 202
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
Remove deprecated verifyZeroInteractions #447
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be a good idea to also bump mockito-core
to 4.0.0 in the same commit, so that we can publish that as-is. Do you mind adding that?
@TimvdLippe I bumped mockito-kotlin/tests/build.gradle Line 25 in 37bbae4
|
@rashadsookram Oh that's strange. Yes we should update the version in both. They should have been using the same version from the get-go. Maybe we can remove that line from the test gradle file altogether, as it will use the artifact inherited from the main bundle? |
... to 4.0.0. Fixes mockito#446.
verify(out).println("methods.stringResult();") | ||
argumentCaptor<DescribedInvocation>().apply { | ||
verify(out).println(capture()) | ||
expect(lastValue.toString()).toBe("methods.stringResult();") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Mockito 2.23.0, println
used to be called with a string, but in 4.0.0 it's called with a DescribedInvocation
directly.
What do you think about checking the value like this? It didn't seem like it would be simple to create an InterceptedInvocation
to use for the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that seems good to me 👍
@TimvdLippe I updated the version in the An alternative would be to make something like the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for me, thanks!
verify(out).println("methods.stringResult();") | ||
argumentCaptor<DescribedInvocation>().apply { | ||
verify(out).println(capture()) | ||
expect(lastValue.toString()).toBe("methods.stringResult();") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that seems good to me 👍
When can we expect a release of mockito-kotlin, which is compatible with Mockito 4? |
@ratepay-sstein I had pushed the 4.0.0 tag yesterday, but it seems like it wasn't running the release procedure. #448 should fix that, thanks for letting us know! |
4.0.0 is now available at https://repo1.maven.org/maven2/org/mockito/kotlin/mockito-kotlin/4.0.0/ |
@TimvdLippe Wow, that was fast :-) I haven't migrated our full source yet, but it seems to work. |
Fixes #446.
I just removed the method for now, but if it's preferred to keep it around and call through to
verifyNoMoreInteractions
instead, let me know and I can update the PR.Thank you for submitting a pull request! But first:
verifyZeroInteractions
as far as I can tell