@Test public void getLobbies() throws Exception { LobbyBalancer info = (LobbyBalancer) Await.result(Patterns.ask(balancer, RequestInformation.INSTANCE, 1000), FiniteDuration.create("1 second")); assertEquals(info.getLobbies().size(), controller.lobbies().toCompletableFuture().get().size()); }
public CompletionStage<Set<Lobby>> lobbies() { final HttpRequest request = HttpRequest.create() .withUri(client.getBaseUri().addPathSegment("lobbies")) .withMethod(HttpMethods.GET); return client.http().singleRequest(request, client.materializer()) .thenCompose(res -> Jackson.unmarshaller(mapper, LobbyBalancer.class) .unmarshall(res.entity(), client.materializer().executionContext(), client.materializer()) ) .thenApply(LobbyBalancer::getLobbies); }
LobbyBalancerController { public CompletionStage<Set<Lobby>> lobbies() { final HttpRequest request = HttpRequest.create() .withUri(client.getBaseUri().addPathSegment("lobbies")) .withMethod(HttpMethods.GET); return client.http().singleRequest(request, client.materializer()) .thenCompose(res -> Jackson.unmarshaller(mapper, LobbyBalancer.class) .unmarshall(res.entity(), client.materializer().executionContext(), client.materializer()) ) .thenApply(LobbyBalancer::getLobbies); } }
LobbyBalancerController { public CompletionStage<Set<Lobby>> lobbies() { final HttpRequest request = HttpRequest.create() .withUri(client.getBaseUri().addPathSegment("lobbies")) .withMethod(HttpMethods.GET); return client.http().singleRequest(request, client.materializer()) .thenCompose(res -> Jackson.unmarshaller(mapper, LobbyBalancer.class) .unmarshall(res.entity(), client.materializer().executionContext(), client.materializer()) ) .thenApply(LobbyBalancer::getLobbies); } LobbyBalancerController(Client client); }
LobbyBalancerController { public CompletionStage<Set<Lobby>> lobbies() { final HttpRequest request = HttpRequest.create() .withUri(client.getBaseUri().addPathSegment("lobbies")) .withMethod(HttpMethods.GET); return client.http().singleRequest(request, client.materializer()) .thenCompose(res -> Jackson.unmarshaller(mapper, LobbyBalancer.class) .unmarshall(res.entity(), client.materializer().executionContext(), client.materializer()) ) .thenApply(LobbyBalancer::getLobbies); } 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<Set<Lobby>> lobbies() { final HttpRequest request = HttpRequest.create() .withUri(client.getBaseUri().addPathSegment("lobbies")) .withMethod(HttpMethods.GET); return client.http().singleRequest(request, client.materializer()) .thenCompose(res -> Jackson.unmarshaller(mapper, LobbyBalancer.class) .unmarshall(res.entity(), client.materializer().executionContext(), client.materializer()) ) .thenApply(LobbyBalancer::getLobbies); } 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();  }