diff options
author | adamw <adam@warski.org> | 2017-07-19 15:24:45 +0200 |
---|---|---|
committer | adamw <adam@warski.org> | 2017-07-19 15:24:45 +0200 |
commit | 3991877faa003a072a175ae59b093beabbd21a50 (patch) | |
tree | b988622cb73eb92f9af8a3881ac1f15d9e361f46 /tests/src/test/scala/com | |
parent | cc475bfae8163836c89ea64726e5e5d4d2fa36d3 (diff) | |
download | sttp-3991877faa003a072a175ae59b093beabbd21a50.tar.gz sttp-3991877faa003a072a175ae59b093beabbd21a50.tar.bz2 sttp-3991877faa003a072a175ae59b093beabbd21a50.zip |
Mapping responses
Diffstat (limited to 'tests/src/test/scala/com')
-rw-r--r-- | tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala | 18 |
1 files changed, 18 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 621968b..2b3bbab 100644 --- a/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala +++ b/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala @@ -137,6 +137,24 @@ class BasicTests response.body should be(expectedPostEchoResponse) } + name should "parse response as string with mapping using map" in { + val response = postEcho + .body(testBody) + .response(asString.map(_.length)) + .send() + .force() + response.body should be(expectedPostEchoResponse.length) + } + + name should "parse response as string with mapping using mapResponse" in { + val response = postEcho + .body(testBody) + .mapResponse(_.length) + .send() + .force() + response.body should be(expectedPostEchoResponse.length) + } + name should "parse response as a byte array" in { val response = postEcho.body(testBody).response(asByteArray).send().force() |