I have a class that has a dependent WSClient dependency:
@Singleton
class MyApiService @Inject() (wsclient: WSClient, conf: Configuration) {
...
}
and when running the test and instantiating MyApiService using the injector:
class MyTest extends FreeSpec with OneAppPerSuite with ScalaFutures with WsScalaTestClient {
implicit lazy val materializer: Materializer = app.materializer
lazy val wsc: WSClient = app.injector.instanceOf[WSClient]
lazy val conf: Configuration = app.injector.instanceOf[Configuration]
val myApiService: MyApiService = app.injector.instanceOf[MyApiService]
"Api Test" in {
...
}
I get this error:
An exception or error caused a stop: cannot be executed, see the following errors:
1) Input error constructor, java.lang.NumberFormatException: format error 10000 with. Play.api.libs.ws.ahc.AsyncHttpClientProvider (AhcWSModule.scala: 40) in play.api.libs.ws.ahc.AsyncHttpClientProvider.class (AhcWSModule.scala: 39) when searching for play.api.libs.ws.ahc .AsyncHttpClientProvider while searching play.shaded.ahc.org .... Called: java.lang.NumberFormatException: format error 10000
and in mine application.congI added:
ws.timeout.connection = 10000
ws.timeout.idle = 10000
ws.timeout.request = 10000
60000 ...
play 2.6.0 scala 2.11.8
- , ?