aboutsummaryrefslogtreecommitdiff
path: root/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala')
-rw-r--r--tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala b/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala
index 262fd35..90aab02 100644
--- a/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala
+++ b/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala
@@ -114,6 +114,8 @@ class BasicTests
override def port = 51823
+ var closeHandlers: List[() => Unit] = Nil
+
runTests("HttpURLConnection")(HttpURLConnectionSttpHandler,
ForceWrappedValue.id)
runTests("Akka HTTP")(AkkaHttpSttpHandler.usingActorSystem(actorSystem),
@@ -129,6 +131,8 @@ class BasicTests
implicit handler: SttpHandler[R, Nothing],
forceResponse: ForceWrappedValue[R]): Unit = {
+ closeHandlers = handler.close _ :: closeHandlers
+
val postEcho = sttp.post(uri"$endpoint/echo")
val testBody = "this is the body"
val testBodyBytes = testBody.getBytes("UTF-8")
@@ -387,4 +391,9 @@ class BasicTests
}
}
}
+
+ override protected def afterAll(): Unit = {
+ closeHandlers.foreach(_())
+ super.afterAll()
+ }
}