diff --git a/akka-stream-tests/src/test/scala/akka/stream/ActorMaterializerSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/ActorMaterializerSpec.scala index 9eedf56da5..943b0e0af2 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/ActorMaterializerSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/ActorMaterializerSpec.scala @@ -1,9 +1,10 @@ package akka.stream +import akka.actor.Props import akka.stream.impl.{ StreamSupervisor, ActorFlowMaterializerImpl } import akka.stream.scaladsl.{ Sink, Source } import akka.stream.testkit.AkkaSpec -import akka.testkit.{ ImplicitSender, TestProbe } +import akka.testkit.{ TestActor, ImplicitSender, TestProbe } import scala.concurrent.Await import scala.concurrent.duration._ @@ -49,6 +50,14 @@ class ActorMaterializerSpec extends AkkaSpec with ImplicitSender { expectNoMsg(1.second) } + "handle properly broken Props" in { + val m = ActorFlowMaterializer.create(system) + an[IllegalArgumentException] should be thrownBy + Await.result( + Source.actorPublisher(Props(classOf[TestActor], "wrong", "arguments")).runWith(Sink.head)(m), + 3.seconds) + } + } }