diff options
author | Bjørn Madsen <bm@aeons.dk> | 2017-08-08 08:16:36 +0200 |
---|---|---|
committer | Bjørn Madsen <bm@aeons.dk> | 2017-08-08 08:16:36 +0200 |
commit | 18db8e9d1ee240d11b558cdb9b5c850c5b063080 (patch) | |
tree | da599b595872cbf26813529fec022b1c0bb99b39 /circe/src/test/scala/com/softwaremill | |
parent | e79d090ed707942f534db98abb1a1754c3584329 (diff) | |
download | sttp-18db8e9d1ee240d11b558cdb9b5c850c5b063080.tar.gz sttp-18db8e9d1ee240d11b558cdb9b5c850c5b063080.tar.bz2 sttp-18db8e9d1ee240d11b558cdb9b5c850c5b063080.zip |
Expand BodySerializer to carry a default content type
And update circe module to use this
Diffstat (limited to 'circe/src/test/scala/com/softwaremill')
-rw-r--r-- | circe/src/test/scala/com/softwaremill/sttp/CirceTests.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/circe/src/test/scala/com/softwaremill/sttp/CirceTests.scala b/circe/src/test/scala/com/softwaremill/sttp/CirceTests.scala index abd20ef..81b90e6 100644 --- a/circe/src/test/scala/com/softwaremill/sttp/CirceTests.scala +++ b/circe/src/test/scala/com/softwaremill/sttp/CirceTests.scala @@ -13,7 +13,7 @@ class CirceTests extends FlatSpec with Matchers with EitherValues { val body = Outer(Inner(42, true, "horses"), "cats") val expected = """{"foo":{"a":42,"b":true,"c":"horses"},"bar":"cats"}""" - val req = sttp.jsonBody(body) + val req = sttp.body(body) extractBody(req) shouldBe expected } @@ -38,7 +38,7 @@ class CirceTests extends FlatSpec with Matchers with EitherValues { it should "should encode and decode back to the same thing" in { val outer = Outer(Inner(42, true, "horses"), "cats") - val encoded = extractBody(sttp.jsonBody(outer)) + val encoded = extractBody(sttp.body(outer)) val decoded = runJsonResponseAs(asJson[Outer])(encoded) decoded.right.value shouldBe outer @@ -46,7 +46,7 @@ class CirceTests extends FlatSpec with Matchers with EitherValues { it should "set the content type" in { val body = Outer(Inner(42, true, "horses"), "cats") - val req = sttp.jsonBody(body) + val req = sttp.body(body) val ct = req.headers.toMap.get("Content-Type") @@ -55,7 +55,7 @@ class CirceTests extends FlatSpec with Matchers with EitherValues { it should "only set the content type if it was not set earlier" in { val body = Outer(Inner(42, true, "horses"), "cats") - val req = sttp.contentType("horses/cats").jsonBody(body) + val req = sttp.contentType("horses/cats").body(body) val ct = req.headers.toMap.get("Content-Type") |