@Test public void testLeaveNoKill() throws Exception { new JavaTestKit(system) { { final Props props = LobbyBalancerActor.props(configuration, 1, 2); final ActorRef subject = system.actorOf(props); final Join req = new Join(team, getRef()); subject.tell(req, getRef()); expectMsgClass(duration("1 second"), JoinSuccess.class); reply(new Leave(team)); expectMsgClass(duration("1 second"), LeaveSuccess.class); expectNoMsg(duration("1 second")); LobbyBalancer info = (LobbyBalancer) Await.result(Patterns.ask(subject, RequestInformation.INSTANCE, 1000), duration("1 second")); assertEquals(1, info.getLobbies().size()); } }; }
public static Props props(LobbyConfiguration configuration, int min, int max) { return Props.create(LobbyBalancerActor.class, () -> new LobbyBalancerActor(configuration, min, max)); }
LobbyBalancerActor extends AbstractActor { public static Props props(LobbyConfiguration configuration, int min, int max) { return Props.create(LobbyBalancerActor.class, () -> new LobbyBalancerActor(configuration, min, max)); } }
LobbyBalancerActor extends AbstractActor { public static Props props(LobbyConfiguration configuration, int min, int max) { return Props.create(LobbyBalancerActor.class, () -> new LobbyBalancerActor(configuration, min, max)); } private  LobbyBalancerActor(LobbyConfiguration configuration, int min, int max); }
LobbyBalancerActor extends AbstractActor { public static Props props(LobbyConfiguration configuration, int min, int max) { return Props.create(LobbyBalancerActor.class, () -> new LobbyBalancerActor(configuration, min, max)); } private  LobbyBalancerActor(LobbyConfiguration configuration, int min, int max); @Override void preStart(); @Override PartialFunction<Object, BoxedUnit> receive(); static Props props(LobbyConfiguration configuration, int min, int max); static Props props(LobbyConfiguration configuration); }
LobbyBalancerActor extends AbstractActor { public static Props props(LobbyConfiguration configuration, int min, int max) { return Props.create(LobbyBalancerActor.class, () -> new LobbyBalancerActor(configuration, min, max)); } private  LobbyBalancerActor(LobbyConfiguration configuration, int min, int max); @Override void preStart(); @Override PartialFunction<Object, BoxedUnit> receive(); static Props props(LobbyConfiguration configuration, int min, int max); static Props props(LobbyConfiguration configuration);  }