New implementation of expectNoMsg in TestKit #23224

This commit is contained in:
Kirill Yankov 2017-09-25 17:37:47 +03:00 committed by Johan Andrén
parent cd4ee59cc8
commit dfd94d3aea
3 changed files with 64 additions and 3 deletions

View file

@ -124,7 +124,9 @@ object TestPublisher {
/**
* Expect no messages.
* NOTE! Timeout value is automatically multiplied by timeFactor.
*/
@deprecated(message = "Use expectNoMessage instead", since = "2.5.5")
def expectNoMsg(): Self = executeAfterSubscription {
probe.expectNoMsg()
self
@ -132,12 +134,22 @@ object TestPublisher {
/**
* Expect no messages for a given duration.
* NOTE! Timeout value is automatically multiplied by timeFactor.
*/
@deprecated(message = "Use expectNoMessage instead", since = "2.5.5")
def expectNoMsg(max: FiniteDuration): Self = executeAfterSubscription {
probe.expectNoMsg(max)
self
}
/**
* Expect no messages for a given duration.
*/
def expectNoMessage(max: FiniteDuration): Self = executeAfterSubscription {
probe.expectNoMessage(max)
self
}
/**
* Receive messages for a given duration or until one does not match a given partial function.
*/
@ -557,7 +569,9 @@ object TestSubscriber {
* Fluent DSL
*
* Same as `expectNoMsg(remaining)`, but correctly treating the timeFactor.
* NOTE! Timeout value is automatically multiplied by timeFactor.
*/
@deprecated(message = "Use expectNoMessage instead", since = "2.5.5")
def expectNoMsg(): Self = {
probe.expectNoMsg()
self
@ -567,12 +581,24 @@ object TestSubscriber {
* Fluent DSL
*
* Assert that no message is received for the specified time.
* NOTE! Timeout value is automatically multiplied by timeFactor.
*/
@deprecated(message = "Use expectNoMessage instead", since = "2.5.5")
def expectNoMsg(remaining: FiniteDuration): Self = {
probe.expectNoMsg(remaining)
self
}
/**
* Fluent DSL
*
* Assert that no message is received for the specified time.
*/
def expectNoMessage(remaining: FiniteDuration): Self = {
probe.expectNoMessage(remaining)
self
}
/**
* Expect a stream element and test it with partial function.
*