@Test public void testTransitToPreparationEnough() throws Exception { new JavaTestKit(system) { { final Props props = LobbyActor.props(new LobbyConfiguration(2, Duration.ofMillis(500), Duration.ofMinutes(5), factory)); final ActorRef subject = system.actorOf(props); final Subscribe req = new Subscribe(getRef()); subject.tell(new Join(new Team(UUID.randomUUID(), "test", 100, new User(UUID.randomUUID(), null)), getRef()), getRef()); expectMsgClass(duration("1 second"), JoinSuccess.class); expectNoMsg(duration("1 second")); Lobby info = (Lobby) Await.result(Patterns.ask(subject, RequestInformation.INSTANCE, 1000), FiniteDuration.create(1000, TimeUnit.MILLISECONDS)); assertEquals(LobbyStatus.PREPARATION, info.getStatus()); } }; }
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);  }