Skip to content

Commit 563b449

Browse files
committed
update notification test kit regarding probes subscription
1 parent bb3faf0 commit 563b449

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

testkit/src/main/scala/app/softnetwork/notification/scalatest/NotificationTestKit.scala

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,8 @@ trait NotificationTestKit[T <: Notification]
9898

9999
val androidDevice: BasicDevice = BasicDevice("test-token-android", Platform.ANDROID)
100100

101-
val probe: TestProbe[Schedule4NotificationTriggered] =
101+
lazy val probe: TestProbe[Schedule4NotificationTriggered] =
102102
createTestProbe[Schedule4NotificationTriggered]()
103-
asystem.eventStream.tell(Subscribe(probe.ref))
104103

105104
lazy val client: NotificationClient = NotificationClient(asystem)
106105

@@ -110,4 +109,14 @@ trait NotificationTestKit[T <: Notification]
110109
override def eventProcessorStreams: ActorSystem[_] => Seq[EventProcessorStream[_]] = sys =>
111110
schedulerEventProcessorStreams(sys) ++
112111
notificationEventProcessorStreams(sys)
112+
113+
def subscribeNotificationProbes(): Unit = {
114+
subscribeProbe(probe)
115+
}
116+
117+
override def beforeAll(): Unit = {
118+
super.beforeAll()
119+
subscribeNotificationProbes()
120+
}
121+
113122
}

0 commit comments

Comments
 (0)