Skip to content

Commit

Permalink
fix: immutable object domain
Browse files Browse the repository at this point in the history
  • Loading branch information
Roiocam committed Sep 23, 2023
1 parent 3ef14e9 commit 581da0c
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ sealed trait WorkerCommand
case class WorkerMultiply(a: Int, b: Int, replyTo: ActorRef[WorkerResult]) extends WorkerCommand
case class WorkerResult(num: Int) extends WorkerCommand

class ManualTerminatedTestSetup(workerCnt: Int) {
class ManualTerminatedTestSetup(val workerLatch: CountDownLatch) {
implicit val timeout: Timeout = 10.millis
val workerLatch = new CountDownLatch(workerCnt)

def forwardBehavior: Behavior[Command] =
setup[Command] { context =>
Expand Down Expand Up @@ -91,7 +90,8 @@ class DeadLetterSpec extends ScalaTestWithActorTestKit(

"DeadLetterActor" must {

"publish dead letter with recipient when context.ask terminated" in new ManualTerminatedTestSetup(workerCnt = 1) {
"publish dead letter with recipient when context.ask terminated" in new ManualTerminatedTestSetup(
workerLatch = new CountDownLatch(1)) {
val deadLetterProbe = createDeadLetterProbe()
val forwardRef = spawn(forwardBehavior)
val workerRef = spawn(workerBehavior)
Expand All @@ -112,7 +112,8 @@ class DeadLetterSpec extends ScalaTestWithActorTestKit(
deadLetter.recipient shouldNot equal(deadLettersRef)
}

"publish dead letter with recipient when AskPattern timeout" in new ManualTerminatedTestSetup(workerCnt = 1) {
"publish dead letter with recipient when AskPattern timeout" in new ManualTerminatedTestSetup(
workerLatch = new CountDownLatch(1)) {
val deadLetterProbe = createDeadLetterProbe()
val workerRef = spawn(workerBehavior)

Expand Down

0 comments on commit 581da0c

Please sign in to comment.