diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala | 10 |
1 files changed, 10 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 b2918fa..9b686dc 100644 --- a/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala +++ b/tests/src/test/scala/com/softwaremill/sttp/BasicTests.scala @@ -548,6 +548,16 @@ class BasicTests val resp = req.send().force() resp.body should be("p1=v1 (f1), p2=v2 (f2)") } + + name should "send a multipart message with a file" in { + val f = File.newTemporaryFile().write(testBody) + try { + val req = + mp.multipartBody(multipart("p1", f.toJava), multipart("p2", "v2")) + val resp = req.send().force() + resp.body should be(s"p1=$testBody (${f.name}), p2=v2") + } finally f.delete() + } } } |