@Test public void controller() throws Exception { LobbyBalancer info = (LobbyBalancer) Await.result(Patterns.ask(balancer, RequestInformation.INSTANCE, 1000), FiniteDuration.create("1 second")); for (Map.Entry<ActorRef, Lobby> entry : info.getLobbies().entrySet()) { controller.controller(entry.getValue().getId()).toCompletableFuture().get(); } }
public CompletionStage<LobbyController> controller(String id) { return lobby(id) .thenApply(lobby -> new LobbyController(client, mapper, lobby.getId())); }
LobbyBalancerController { public CompletionStage<LobbyController> controller(String id) { return lobby(id) .thenApply(lobby -> new LobbyController(client, mapper, lobby.getId())); } }
LobbyBalancerController { public CompletionStage<LobbyController> controller(String id) { return lobby(id) .thenApply(lobby -> new LobbyController(client, mapper, lobby.getId())); } LobbyBalancerController(Client client); }
LobbyBalancerController { public CompletionStage<LobbyController> controller(String id) { return lobby(id) .thenApply(lobby -> new LobbyController(client, mapper, lobby.getId())); } LobbyBalancerController(Client client); CompletionStage<Set<Lobby>> lobbies(); CompletionStage<Set<LobbyController>> controllers(); CompletionStage<Lobby> lobby(String id); CompletionStage<LobbyController> controller(String id); LobbyController controller(Lobby lobby); CompletionStage<LobbyController> find(); }
LobbyBalancerController { public CompletionStage<LobbyController> controller(String id) { return lobby(id) .thenApply(lobby -> new LobbyController(client, mapper, lobby.getId())); } LobbyBalancerController(Client client); CompletionStage<Set<Lobby>> lobbies(); CompletionStage<Set<LobbyController>> controllers(); CompletionStage<Lobby> lobby(String id); CompletionStage<LobbyController> controller(String id); LobbyController controller(Lobby lobby); CompletionStage<LobbyController> find();  }