Add web client tests

This commit is contained in:
2020-07-11 21:19:29 +07:00
parent 45b6f104fb
commit a8b2346b16
2 changed files with 28 additions and 3 deletions

View File

@@ -2,8 +2,6 @@ package com.cubetiqs.wsclient
import org.springframework.web.reactive.function.client.WebClient
import reactor.core.publisher.Flux
import reactor.kotlin.extra.retry.retryExponentialBackoff
import java.time.Duration
class WebClientStockClient(val webClient: WebClient) : StockClient {
override fun priceFor(symbol: String): Flux<StockPrice> {
@@ -11,7 +9,6 @@ class WebClientStockClient(val webClient: WebClient) : StockClient {
.uri("http://localhost:8080/stocks/{symbol}", symbol)
.retrieve()
.bodyToFlux(StockPrice::class.java)
.retryExponentialBackoff(5, Duration.ofSeconds(10), Duration.ofSeconds(20))
.doOnError {
println(it.message)
}