@Test public void testProgressionInform() throws Exception { new JavaTestKit(system) { { final JavaTestKit probe = new JavaTestKit(system); final LobbyConfiguration configuration = new LobbyConfiguration(2, Duration.ofSeconds(1), Duration.ZERO, factory); final Props props = LobbyActor.props(configuration); final ActorRef subject = system.actorOf(props); final Join req = new Join(team, getRef()); subject.tell(new Subscribe(probe.getRef()), probe.getRef()); subject.tell(req, getRef()); expectMsgClass(duration("1 second"), JoinSuccess.class); probe.expectMsgClass(duration("1 second"), TeamJoined.class); probe.expectMsgEquals(duration("2 second"), new LobbyStatusChanged(LobbyStatus.INTERMISSION, LobbyStatus.PREPARATION)); probe.expectMsgEquals(duration("1 second"), new LobbyStatusChanged(LobbyStatus.PREPARATION, LobbyStatus.PROGRESSION)); subject.tell(RequestInformation.INSTANCE, getRef()); expectMsgEquals(duration("1 second"), new Lobby(subject.path().name(), LobbyStatus.PROGRESSION, configuration, Collections.singleton(team), schedule)); system.stop(subject); } }; }
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);  }