Add expectNoMessage to subscriber probe
This commit is contained in:
parent
e3dc7b16b3
commit
f75f1943a2
5 changed files with 19 additions and 7 deletions
|
|
@ -115,11 +115,11 @@ class RecipeGlobalRateLimit extends RecipeSpec {
|
||||||
|
|
||||||
probe.expectNext() should startWith("E")
|
probe.expectNext() should startWith("E")
|
||||||
probe.expectNext() should startWith("E")
|
probe.expectNext() should startWith("E")
|
||||||
probe.expectNoMsg(500.millis)
|
probe.expectNoMessage()
|
||||||
|
|
||||||
limiter ! Limiter.ReplenishTokens
|
limiter ! Limiter.ReplenishTokens
|
||||||
probe.expectNext() should startWith("E")
|
probe.expectNext() should startWith("E")
|
||||||
probe.expectNoMsg(500.millis)
|
probe.expectNoMessage()
|
||||||
|
|
||||||
var resultSet = Set.empty[String]
|
var resultSet = Set.empty[String]
|
||||||
for (_ <- 1 to 100) {
|
for (_ <- 1 to 100) {
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ class RecipeMissedTicks extends RecipeSpec {
|
||||||
sub.expectNext(3)
|
sub.expectNext(3)
|
||||||
|
|
||||||
subscription.request(1)
|
subscription.request(1)
|
||||||
sub.expectNoMsg(100.millis)
|
sub.expectNoMessage()
|
||||||
|
|
||||||
pub.sendNext(())
|
pub.sendNext(())
|
||||||
sub.expectNext(0)
|
sub.expectNext(0)
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ class RecipeSimpleDrop extends RecipeSpec {
|
||||||
messageSource.via(realDroppyStream).to(sink).run()
|
messageSource.via(realDroppyStream).to(sink).run()
|
||||||
|
|
||||||
val subscription = sub.expectSubscription()
|
val subscription = sub.expectSubscription()
|
||||||
sub.expectNoMsg(100.millis)
|
sub.expectNoMessage()
|
||||||
|
|
||||||
pub.sendNext("1")
|
pub.sendNext("1")
|
||||||
pub.sendNext("2")
|
pub.sendNext("2")
|
||||||
|
|
|
||||||
|
|
@ -625,6 +625,18 @@ object TestSubscriber {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fluent DSL
|
||||||
|
*
|
||||||
|
* Assert that no message is received for the specified time.
|
||||||
|
* Waits for the default period configured as `akka.test.expect-no-message-default`.
|
||||||
|
* That timeout is scaled using the configuration entry "akka.test.timefactor".
|
||||||
|
*/
|
||||||
|
def expectNoMessage(): Self = {
|
||||||
|
probe.expectNoMessage()
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Java API: Assert that no message is received for the specified time.
|
* Java API: Assert that no message is received for the specified time.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ class FlowAskSpec extends StreamSpec {
|
||||||
sub.request(2)
|
sub.request(2)
|
||||||
c.expectNext(Reply(1))
|
c.expectNext(Reply(1))
|
||||||
c.expectNext(Reply(2))
|
c.expectNext(Reply(2))
|
||||||
c.expectNoMessage(200.millis)
|
c.expectNoMessage()
|
||||||
sub.request(2)
|
sub.request(2)
|
||||||
c.expectNext(Reply(3))
|
c.expectNext(Reply(3))
|
||||||
c.expectComplete()
|
c.expectComplete()
|
||||||
|
|
@ -120,7 +120,7 @@ class FlowAskSpec extends StreamSpec {
|
||||||
sub.request(2)
|
sub.request(2)
|
||||||
c.expectNext(Reply(1))
|
c.expectNext(Reply(1))
|
||||||
c.expectNext(Reply(2))
|
c.expectNext(Reply(2))
|
||||||
c.expectNoMessage(200.millis)
|
c.expectNoMessage()
|
||||||
sub.request(2)
|
sub.request(2)
|
||||||
c.expectNext(Reply(3))
|
c.expectNext(Reply(3))
|
||||||
c.expectComplete()
|
c.expectComplete()
|
||||||
|
|
@ -132,7 +132,7 @@ class FlowAskSpec extends StreamSpec {
|
||||||
sub.request(2)
|
sub.request(2)
|
||||||
c.expectNext(Reply(1))
|
c.expectNext(Reply(1))
|
||||||
c.expectNext(Reply(2))
|
c.expectNext(Reply(2))
|
||||||
c.expectNoMessage(200.millis)
|
c.expectNoMessage()
|
||||||
sub.request(2)
|
sub.request(2)
|
||||||
c.expectNext(Reply(3))
|
c.expectNext(Reply(3))
|
||||||
c.expectComplete()
|
c.expectComplete()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue