+ public void killActor(ActorRef actor, JavaTestKit kit) {
+ killActor(actor, kit, true);
+ }
+
+ public String createTestActorPath(String actorId){
+ return "akka://test/user/" + actorId;
+ }
+
+ private void killActor(ActorRef actor, JavaTestKit kit, boolean remove) {
+ LOG.info("Killing actor {}", actor);
+ kit.watch(actor);
+ actor.tell(PoisonPill.getInstance(), ActorRef.noSender());
+ kit.expectTerminated(JavaTestKit.duration("5 seconds"), actor);
+
+ if(remove) {
+ createdActors.remove(actor);
+ }
+ }
+