Skip to content

Commit da09d15

Browse files
committed
Fixed StepParent behavior to not report failures
1 parent ace0aab commit da09d15

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

chapter04/src/test/scala/com/reactivedesignpatterns/chapter4/StepParentSpec.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,18 @@ class StepParentSpec extends WordSpec with Matchers with BeforeAndAfterAll {
1010
"Result in the supervisor returning a reference to that actor" in {
1111
implicit val system = ActorSystem()
1212
val testProbe = TestProbe()
13-
val parent = system.actorOf(Props(new StepParent(testProbe.ref)), "stepParent")
13+
val parent = system.actorOf(Props[StepParent], "stepParent")
1414
parent.tell(Props[MyActor], testProbe.ref)
1515
val child = testProbe.expectMsgType[ActorRef]
16-
child ! TestMessage
1716
}
1817
}
1918
}
2019

2120
case object TestMessage
2221

23-
class StepParent(target: ActorRef) extends Actor {
22+
class StepParent extends Actor {
2423
override val supervisorStrategy = OneForOneStrategy() {
25-
case thr: Throwable => target ! thr; Restart
24+
case thr => Restart
2625
}
2726
def receive = {
2827
case p: Props =>

0 commit comments

Comments
 (0)