Skip to content

Commit feaf63e

Browse files
committed
Make after() return type non-null
1 parent 4779b29 commit feaf63e

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

mockito-kotlin/src/main/kotlin/com/nhaarman/mockitokotlin2/Verification.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ fun description(description: String): VerificationMode {
165165
* interaction rather than failing immediately if has not already happened. May be useful for testing in concurrent
166166
* conditions.
167167
*/
168-
fun after(millis: Long): VerificationAfterDelay? {
169-
return Mockito.after(millis)
168+
fun after(millis: Long): VerificationAfterDelay {
169+
return Mockito.after(millis)!!
170170
}
171171

172172
/**

tests/src/test/kotlin/test/VerificationTest.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,12 @@ class VerificationTest : TestBase() {
103103
expect(e.message).toContain("Test")
104104
}
105105
}
106+
107+
@Test
108+
fun testAfter() {
109+
mock<Methods>().apply {
110+
int(3)
111+
verify(this, after(10)).int(3)
112+
}
113+
}
106114
}

0 commit comments

Comments
 (0)