diff options
Diffstat (limited to 'tests/src/test/scala/com')
-rw-r--r-- | tests/src/test/scala/com/softwaremill/sttp/IllTypedTests.scala | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/src/test/scala/com/softwaremill/sttp/IllTypedTests.scala b/tests/src/test/scala/com/softwaremill/sttp/IllTypedTests.scala new file mode 100644 index 0000000..caf6632 --- /dev/null +++ b/tests/src/test/scala/com/softwaremill/sttp/IllTypedTests.scala @@ -0,0 +1,23 @@ +package com.softwaremill.sttp + +import org.scalatest.{FlatSpec, Matchers} + +class IllTypedTests extends FlatSpec with Matchers { + "compilation" should "fail when trying to stream using the default handler" in { + """ + import akka.stream.scaladsl.Source + import akka.util.ByteString + import java.net.URI + implicit val sttpHandler = HttpConnectionSttpHandler + sttp.get(new URI("http://example.com")).send(responseAsStream[Source[ByteString, Any]]) + """ shouldNot typeCheck + } + + "compilation" should "fail when trying to send a request without giving an URL" in { + """ + import java.net.URI + implicit val sttpHandler = HttpConnectionSttpHandler + sttp.send(responseAsString) + """ shouldNot typeCheck + } +} |