@Test public void testLeaveSuccessDifferentHandlerSubscribed() { new JavaTestKit(system) { { final Props props = LobbyActor.props(configuration); final ActorRef subject = system.actorOf(props); final Leave req = new Leave(team); final JavaTestKit probe = new JavaTestKit(system); subject.tell(new Subscribe(probe.getRef()), probe.getRef()); subject.tell(new Join(team, probe.getRef()), getRef()); probe.expectMsgClass(duration("1 second"), TeamJoined.class); expectMsgClass(duration("1 second"), JoinSuccess.class); subject.tell(req, getRef()); expectMsgClass(duration("1 second"), LeaveSuccess.class); probe.expectMsgEquals(duration("1 second"), new TeamLeft(team)); } }; }
public static Props props(LobbyConfiguration configuration) { return Props.create(LobbyActor.class, () -> new LobbyActor(configuration)); }
LobbyActor extends AbstractActor { public static Props props(LobbyConfiguration configuration) { return Props.create(LobbyActor.class, () -> new LobbyActor(configuration)); } }
LobbyActor extends AbstractActor { public static Props props(LobbyConfiguration configuration) { return Props.create(LobbyActor.class, () -> new LobbyActor(configuration)); } private  LobbyActor(LobbyConfiguration configuration); }
LobbyActor extends AbstractActor { public static Props props(LobbyConfiguration configuration) { return Props.create(LobbyActor.class, () -> new LobbyActor(configuration)); } private  LobbyActor(LobbyConfiguration configuration); @Override PartialFunction<Object, BoxedUnit> receive(); static Props props(LobbyConfiguration configuration); }
LobbyActor extends AbstractActor { public static Props props(LobbyConfiguration configuration) { return Props.create(LobbyActor.class, () -> new LobbyActor(configuration)); } private  LobbyActor(LobbyConfiguration configuration); @Override PartialFunction<Object, BoxedUnit> receive(); static Props props(LobbyConfiguration configuration);  }