@@ -17,7 +17,7 @@ import play.api.libs.ws.{EmptyBody, InMemoryBody, StandaloneWSRequest, Standalon
17
17
import scommons .api .http .ApiHttpData .{StringData , UrlEncodedFormData }
18
18
import scommons .api .http .{ApiHttpData , ApiHttpResponse }
19
19
20
- import scala .concurrent .Future
20
+ import scala .concurrent .{ ExecutionContext , Future }
21
21
import scala .concurrent .duration ._
22
22
23
23
class WsApiHttpClientSpec extends FlatSpec
@@ -33,14 +33,14 @@ class WsApiHttpClientSpec extends FlatSpec
33
33
)
34
34
35
35
private implicit val system : ActorSystem = ActorSystem (getClass.getSimpleName)
36
+ private implicit val ec : ExecutionContext = system.dispatcher
36
37
private implicit val materializer : ActorMaterializer = ActorMaterializer ()
37
38
38
39
private val baseUrl = " http://test.api.client"
39
40
private val response = mock[StandaloneWSResponse ]
41
+ private val wsClient = StandaloneAhcWSClient ()
40
42
41
- private class TestWsClient extends WsApiHttpClient (baseUrl) {
42
-
43
- override private [ws] val ws = spy(StandaloneAhcWSClient ())
43
+ private class TestWsClient extends WsApiHttpClient (wsClient, baseUrl) {
44
44
45
45
override private [ws] def execute (req : StandaloneWSRequest ): Future [StandaloneWSResponse ] = {
46
46
Future .successful(response)
@@ -62,11 +62,8 @@ class WsApiHttpClientSpec extends FlatSpec
62
62
}
63
63
64
64
override protected def afterAll (): Unit = {
65
- reset(client.ws)
66
-
65
+ wsClient.close()
67
66
system.terminate().futureValue
68
-
69
- verify(client.ws).close()
70
67
}
71
68
72
69
it should " execute request without body" in {
0 commit comments