Skip to content

Commit

Permalink
Issue #106: Added method to stop actor to 'ActorSystemResource'.
Browse files Browse the repository at this point in the history
Signed-off-by: Juergen Fickel <juergen.fickel@bosch.io>
  • Loading branch information
Juergen Fickel committed Nov 12, 2021
1 parent 68792a7 commit 8bc082e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ public ActorRef newActor(final Props props, final CharSequence actorName) {
return actorSystem.actorOf(props, actorName.toString());
}

public void stopActor(final ActorRef actorRef) {
final var actorSystem = getActorSystem();
actorSystem.stop(ConditionChecker.checkNotNull(actorRef, "actorRef"));
}

@Override
protected void after() {
TestKit.shutdownActorSystem(actorSystem, Duration.apply(5, TimeUnit.SECONDS), false);
Expand Down

0 comments on commit 8bc082e

Please sign in to comment.