=tes Add parameter scaladocs to expectTerminated (#23227)
* Add API parameter comments to expectTerminated (Fixes #23091) * Clarify that expectTerminated requires watch(target) beforehand
This commit is contained in:
parent
403702d19f
commit
1b1b825865
2 changed files with 12 additions and 0 deletions
|
|
@ -408,8 +408,11 @@ trait TestKitBase {
|
|||
|
||||
/**
|
||||
* Receive one message from the test actor and assert that it is the Terminated message of the given ActorRef.
|
||||
* Before calling this method, you have to `watch` the target actor ref.
|
||||
* Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
|
||||
*
|
||||
* @param target the actor ref expected to be Terminated
|
||||
* @param max wait no more than max time, otherwise throw AssertionFailure
|
||||
* @return the received Terminated message
|
||||
*/
|
||||
def expectTerminated(target: ActorRef, max: Duration = Duration.Undefined): Terminated =
|
||||
|
|
|
|||
|
|
@ -334,13 +334,22 @@ class TestKit(system: ActorSystem) {
|
|||
|
||||
/**
|
||||
* Receive one message from the test actor and assert that it is the Terminated message of the given ActorRef.
|
||||
* Before calling this method, you have to `watch` the target actor ref.
|
||||
* Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
|
||||
*
|
||||
* @param max wait no more than max time, otherwise throw AssertionFailure
|
||||
* @param target the actor ref expected to be Terminated
|
||||
* @return the received Terminated message
|
||||
*/
|
||||
def expectTerminated(max: Duration, target: ActorRef): Terminated = tp.expectTerminated(target, max)
|
||||
|
||||
/**
|
||||
* Receive one message from the test actor and assert that it is the Terminated message of the given ActorRef.
|
||||
* Before calling this method, you have to `watch` the target actor ref.
|
||||
* Wait time is bounded by the given duration, with an AssertionFailure being thrown in case of timeout.
|
||||
*
|
||||
* @param target the actor ref expected to be Terminated
|
||||
* @return the received Terminated message
|
||||
*/
|
||||
def expectTerminated(target: ActorRef): Terminated = tp.expectTerminated(target)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue