@Test public void testTransitToProgression() throws Exception { new JavaTestKit(system) { { final Props props = LobbyActor.props(new LobbyConfiguration(2, Duration.ofMillis(500), Duration.ofMillis(500), factory)); final ActorRef subject = system.actorOf(props); final Subscribe req = new Subscribe(getRef()); subject.tell(req, getRef()); subject.tell(new Join(new Team(UUID.randomUUID(), "test", 100, new User(UUID.randomUUID(), null)), getRef()), getRef()); expectMsgClass(duration("1 second"), JoinSuccess.class); expectMsgClass(duration("1 second"), TeamJoined.class); expectMsgEquals(duration("1 second"), new LobbyStatusChanged(LobbyStatus.INTERMISSION, LobbyStatus.PREPARATION)); expectMsgEquals(duration("2 second"), new LobbyStatusChanged(LobbyStatus.PREPARATION, LobbyStatus.PROGRESSION)); system.stop(subject); } }; }
private void transitToProgression(LobbyStatusChanged event) { log.info("Changing lobby status from {} to {}", event.getPrevious(), event.getStatus()); bus.tell(event, self()); context().become(progression()); }
LobbyActor extends AbstractActor { private void transitToProgression(LobbyStatusChanged event) { log.info("Changing lobby status from {} to {}", event.getPrevious(), event.getStatus()); bus.tell(event, self()); context().become(progression()); } }
LobbyActor extends AbstractActor { private void transitToProgression(LobbyStatusChanged event) { log.info("Changing lobby status from {} to {}", event.getPrevious(), event.getStatus()); bus.tell(event, self()); context().become(progression()); } private  LobbyActor(LobbyConfiguration configuration); }
LobbyActor extends AbstractActor { private void transitToProgression(LobbyStatusChanged event) { log.info("Changing lobby status from {} to {}", event.getPrevious(), event.getStatus()); bus.tell(event, self()); context().become(progression()); } private  LobbyActor(LobbyConfiguration configuration); @Override PartialFunction<Object, BoxedUnit> receive(); static Props props(LobbyConfiguration configuration); }
LobbyActor extends AbstractActor { private void transitToProgression(LobbyStatusChanged event) { log.info("Changing lobby status from {} to {}", event.getPrevious(), event.getStatus()); bus.tell(event, self()); context().become(progression()); } private  LobbyActor(LobbyConfiguration configuration); @Override PartialFunction<Object, BoxedUnit> receive(); static Props props(LobbyConfiguration configuration);  }