@@ -42,7 +42,7 @@ with DispatchCleanup {
4242 def succeedOn (successRetry : Int )() = {
4343 Http .default(localhost << Map (" echo" -> retried.getAndIncrement.toString)
4444 OK as.String ).either.map { eth =>
45- eth.right. flatMap { numstr =>
45+ eth.flatMap { numstr =>
4646 val num = numstr.toInt
4747 if (num == successRetry)
4848 Right (num)
@@ -55,19 +55,19 @@ with DispatchCleanup {
5555
5656 property(" succeed on the first request" ) = forAll(smallNums) { maxRetries =>
5757 val rc = new RetryCounter
58- val p = retry.Backoff (maxRetries)(() => rc.succeedOn(0 ))
58+ val p = retry.Backoff (maxRetries)(() => rc.succeedOn(0 )() )
5959 p() ?= Right (0 )
6060 }
6161
6262 property(" succeed on the max retry" ) = forAll(smallNums) { maxRetries =>
6363 val rc = new RetryCounter
64- val p = retry.Directly (maxRetries)(() => rc.succeedOn(maxRetries))
64+ val p = retry.Directly (maxRetries)(() => rc.succeedOn(maxRetries)() )
6565 p() ?= Right (maxRetries)
6666 }
6767
6868 property(" fail after max retries" ) = forAll(smallNums) { maxRetries =>
6969 val rc = new RetryCounter
70- val p = retry.Directly (maxRetries)(() => rc.succeedOn(maxRetries + 1 ))
70+ val p = retry.Directly (maxRetries)(() => rc.succeedOn(maxRetries + 1 )() )
7171 p() ?= Left (maxRetries)
7272 }
7373
@@ -76,7 +76,7 @@ with DispatchCleanup {
7676 val p = retry.Backoff (
7777 max,
7878 Duration (2 , TimeUnit .MICROSECONDS )
79- )(() => rc.succeedOn(max))
79+ )(() => rc.succeedOn(max)() )
8080 p() ?= Right (max)
8181 }
8282
@@ -85,7 +85,7 @@ with DispatchCleanup {
8585 val p = retry.Pause (
8686 max,
8787 Duration (500 , TimeUnit .MICROSECONDS )
88- )(() => rc.succeedOn(max + 1 ))
88+ )(() => rc.succeedOn(max + 1 )() )
8989 p() ?= Left (max)
9090 }
9191}
0 commit comments