From a2f3939a89c8b291c4697e822bb931703b3bd3ba Mon Sep 17 00:00:00 2001 From: adamw Date: Thu, 6 Jul 2017 15:59:40 +0200 Subject: Non-compilation tests --- .../com/softwaremill/sttp/IllTypedTests.scala | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/src/test/scala/com/softwaremill/sttp/IllTypedTests.scala (limited to 'tests/src/test/scala') 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 + } +} -- cgit v1.2.3