Skip to content

Commit

Permalink
Add verifyNoInteractions, mark verifyZeroInteractions as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre Prinz committed Jan 12, 2021
1 parent b8f480f commit e027920
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mockito-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies {
compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compileOnly 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.0'

compile "org.mockito:mockito-core:2.23.0"
compile "org.mockito:mockito-core:3.7.0"

testCompile 'junit:junit:4.12'
testCompile 'com.nhaarman:expect.kt:1.0.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,21 @@ fun <T> verifyNoMoreInteractions(vararg mocks: T) {
/**
* Verifies that no interactions happened on given mocks beyond the previously verified interactions.
*
* Alias for [Mockito.verifyZeroInteractions].
* Alias for [Mockito.verifyNoInteractions].
*/
fun verifyNoInteractions(vararg mocks: Any) {
Mockito.verifyNoInteractions(*mocks)
}

/**
* @deprecated
*
* Please migrate your code to [verifyNoInteractions].
*/
@Deprecated(
"Use verifyNoInteractions() instead.",
ReplaceWith("verifyNoInteractions(vararg mocks: Any)")
)
fun verifyZeroInteractions(vararg mocks: Any) {
Mockito.verifyZeroInteractions(*mocks)
}
Expand Down

0 comments on commit e027920

Please sign in to comment.