aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradamw <adam@warski.org>2017-07-24 17:11:02 +0200
committeradamw <adam@warski.org>2017-07-24 17:11:02 +0200
commitfc62bf67b23793b3766f527de5ffac73e78d2d18 (patch)
treec62aefd4c9aa06d2d8db1ec0750336bb05ba27ec
parent81d290bc8658841f48d8a7fc10d88813eba16ffc (diff)
downloadsttp-fc62bf67b23793b3766f527de5ffac73e78d2d18.tar.gz
sttp-fc62bf67b23793b3766f527de5ffac73e78d2d18.tar.bz2
sttp-fc62bf67b23793b3766f527de5ffac73e78d2d18.zip
Additional empty-body tests
-rw-r--r--akka-http-handler/src/main/scala/com/softwaremill/sttp/akkahttp/AkkaHttpSttpHandler.scala5
-rw-r--r--async-http-client-handler/src/main/scala/com/softwaremill/sttp/asynchttpclient/AsyncHttpClientHandler.scala2
-rw-r--r--tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala5
3 files changed, 8 insertions, 4 deletions
diff --git a/akka-http-handler/src/main/scala/com/softwaremill/sttp/akkahttp/AkkaHttpSttpHandler.scala b/akka-http-handler/src/main/scala/com/softwaremill/sttp/akkahttp/AkkaHttpSttpHandler.scala
index 49446f2..f0262fc 100644
--- a/akka-http-handler/src/main/scala/com/softwaremill/sttp/akkahttp/AkkaHttpSttpHandler.scala
+++ b/akka-http-handler/src/main/scala/com/softwaremill/sttp/akkahttp/AkkaHttpSttpHandler.scala
@@ -173,10 +173,9 @@ class AkkaHttpSttpHandler private (actorSystem: ActorSystem,
decoder.decodeMessage(response)
}
- def close(): Future[Unit] = {
+ override def close(): Unit = {
implicit val ec = this.ec
- if (terminateActorSystemOnClose) actorSystem.terminate().map(_ => ())
- else Future.successful(())
+ if (terminateActorSystemOnClose) actorSystem.terminate()
}
private implicit class RichTry[T](t: Try[T]) {
diff --git a/async-http-client-handler/src/main/scala/com/softwaremill/sttp/asynchttpclient/AsyncHttpClientHandler.scala b/async-http-client-handler/src/main/scala/com/softwaremill/sttp/asynchttpclient/AsyncHttpClientHandler.scala
index 1e924a0..ab35725 100644
--- a/async-http-client-handler/src/main/scala/com/softwaremill/sttp/asynchttpclient/AsyncHttpClientHandler.scala
+++ b/async-http-client-handler/src/main/scala/com/softwaremill/sttp/asynchttpclient/AsyncHttpClientHandler.scala
@@ -218,7 +218,7 @@ abstract class AsyncHttpClientHandler[R[_], S](
}
}
- def close(): Unit = {
+ override def close(): Unit = {
if (closeClient)
asyncHttpClient.close()
}
diff --git a/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala b/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala
index 00d9e6f..e5a73f7 100644
--- a/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala
+++ b/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala
@@ -262,6 +262,11 @@ class BasicTests
.force()
response.body should be("a==/b c:=/d")
}
+
+ name should "post without a body" in {
+ val response = postEcho.send().force()
+ response.body should be("POST /echo")
+ }
}
def headerTests(): Unit = {