Skip to content

Commit

Permalink
Make after() return type non-null
Browse files Browse the repository at this point in the history
  • Loading branch information
nhaarman committed Jul 5, 2019
1 parent 4779b29 commit feaf63e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Expand Up @@ -165,8 +165,8 @@ fun description(description: String): VerificationMode {
* interaction rather than failing immediately if has not already happened. May be useful for testing in concurrent
* conditions.
*/
fun after(millis: Long): VerificationAfterDelay? {
return Mockito.after(millis)
fun after(millis: Long): VerificationAfterDelay {
return Mockito.after(millis)!!
}

/**
Expand Down
8 changes: 8 additions & 0 deletions tests/src/test/kotlin/test/VerificationTest.kt
Expand Up @@ -103,4 +103,12 @@ class VerificationTest : TestBase() {
expect(e.message).toContain("Test")
}
}

@Test
fun testAfter() {
mock<Methods>().apply {
int(3)
verify(this, after(10)).int(3)
}
}
}

0 comments on commit feaf63e

Please sign in to comment.