Stream Testkit: new-API-friendly (#29831)

This commit is contained in:
Enno Runne 2020-12-01 12:06:09 +01:00 committed by GitHub
parent 5db6a3a491
commit ffb21da246
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 86 additions and 26 deletions

View file

@ -112,7 +112,7 @@ class StreamTestKitDocSpec extends AkkaSpec {
//#test-sink-probe
val sourceUnderTest = Source(1 to 4).filter(_ % 2 == 0).map(_ * 2)
sourceUnderTest.runWith(TestSink.probe[Int]).request(2).expectNext(4, 8).expectComplete()
sourceUnderTest.runWith(TestSink[Int]()).request(2).expectNext(4, 8).expectComplete()
//#test-sink-probe
}
@ -142,7 +142,7 @@ class StreamTestKitDocSpec extends AkkaSpec {
pattern.after(10.millis * sleep, using = system.scheduler)(Future.successful(sleep))
}
val (pub, sub) = TestSource.probe[Int].via(flowUnderTest).toMat(TestSink.probe[Int])(Keep.both).run()
val (pub, sub) = TestSource.probe[Int].via(flowUnderTest).toMat(TestSink[Int]())(Keep.both).run()
sub.request(n = 3)
pub.sendNext(3)