Skip to content

Commit

Permalink
Decreases verifyTimeout to 100 ms
Browse files Browse the repository at this point in the history
  • Loading branch information
Yves Bonjour committed Mar 29, 2018
1 parent 99fcb2a commit bc54419
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/kotlin/ch/yvu/rxpect/BaseExpectation.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import org.mockito.invocation.InvocationOnMock
import org.mockito.invocation.Location
import org.mockito.stubbing.OngoingStubbing
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit.SECONDS
import java.util.concurrent.TimeUnit.MILLISECONDS

abstract class BaseExpectation : FulfillableExpectation {
companion object {
const val verifyTimeoutInSeconds = 1L
const val verifyTimeoutInMilliSeconds = 100L
}

private val latch: CountDownLatch = CountDownLatch(1)
Expand All @@ -29,14 +29,14 @@ abstract class BaseExpectation : FulfillableExpectation {
}

override fun verify() {
val result = latch.await(verifyTimeoutInSeconds, SECONDS)
val result = latch.await(verifyTimeoutInMilliSeconds, MILLISECONDS)
if (!result) {
throw buildWantedButNotInvoked(invocation, mockingDetails(mock))
}
}

override fun verifyNotFulfilled() {
val result = latch.await(verifyTimeoutInSeconds, SECONDS)
val result = latch.await(verifyTimeoutInMilliSeconds, MILLISECONDS)
if (result) {
invocationLocation.let {
if (it == null) {
Expand Down

0 comments on commit bc54419

Please sign in to comment.