mockito / mockito-kotlin

Using Mockito with Kotlin
MIT License
3.09k stars 198 forks source link

Remove deprecated verifyZeroInteractions #447

Closed rashadsookram closed 2 years ago

rashadsookram commented 2 years ago

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:

rashadsookram commented 2 years ago

@TimvdLippe I bumped mockito-core in the mockito-kotlin module, but left it as-is in the tests module. Should it be updated there too? It looks like it's on an even older version: https://github.com/mockito/mockito-kotlin/blob/37bbae48634d879640a754a1b122db99f0b00478/tests/build.gradle#L25

TimvdLippe commented 2 years ago

@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?

rashadsookram commented 2 years ago

@TimvdLippe I updated the version in the tests module, but it didn't seem like removing the version from there would work. When I tried to remove it, the tests failed with NoClassDefFoundErrors since Mockito wasn't on the classpath. This makes sense to me, since the tests project only depends on the Mockito-Kotlin jar, which doesn't contain the classes from Mockito.

An alternative would be to make something like the dependencies.gradle file in Mockito, so that the versions could be shared between the different Gradle subprojects.

ratepay-sstein commented 2 years ago

When can we expect a release of mockito-kotlin, which is compatible with Mockito 4?

TimvdLippe commented 2 years ago

@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!

TimvdLippe commented 2 years ago

4.0.0 is now available at https://repo1.maven.org/maven2/org/mockito/kotlin/mockito-kotlin/4.0.0/

ratepay-sstein commented 2 years ago

@TimvdLippe Wow, that was fast :-) I haven't migrated our full source yet, but it seems to work.