@Test public void list() throws Exception { System.out.println(controller.list().toCompletableFuture().get()); }
public CompletionStage<List<Team>> list() { return client.http().singleRequest(HttpRequest.create() .withUri(client.getBaseUri().addPathSegment("teams")) .withMethod(HttpMethods.GET) .addHeader(Authorization.basic(credentials.getUsername(), credentials.getPassword())), client.materializer()) .thenCompose(res -> Jackson.unmarshaller(mapper, Team[].class) .unmarshall(res.entity(), client.materializer().executionContext(), client.materializer())) .thenApply(Arrays::asList); }
TeamController { public CompletionStage<List<Team>> list() { return client.http().singleRequest(HttpRequest.create() .withUri(client.getBaseUri().addPathSegment("teams")) .withMethod(HttpMethods.GET) .addHeader(Authorization.basic(credentials.getUsername(), credentials.getPassword())), client.materializer()) .thenCompose(res -> Jackson.unmarshaller(mapper, Team[].class) .unmarshall(res.entity(), client.materializer().executionContext(), client.materializer())) .thenApply(Arrays::asList); } }
TeamController { public CompletionStage<List<Team>> list() { return client.http().singleRequest(HttpRequest.create() .withUri(client.getBaseUri().addPathSegment("teams")) .withMethod(HttpMethods.GET) .addHeader(Authorization.basic(credentials.getUsername(), credentials.getPassword())), client.materializer()) .thenCompose(res -> Jackson.unmarshaller(mapper, Team[].class) .unmarshall(res.entity(), client.materializer().executionContext(), client.materializer())) .thenApply(Arrays::asList); } TeamController(Client client, Credentials credentials); }
TeamController { public CompletionStage<List<Team>> list() { return client.http().singleRequest(HttpRequest.create() .withUri(client.getBaseUri().addPathSegment("teams")) .withMethod(HttpMethods.GET) .addHeader(Authorization.basic(credentials.getUsername(), credentials.getPassword())), client.materializer()) .thenCompose(res -> Jackson.unmarshaller(mapper, Team[].class) .unmarshall(res.entity(), client.materializer().executionContext(), client.materializer())) .thenApply(Arrays::asList); } TeamController(Client client, Credentials credentials); CompletionStage<List<Team>> list(); }
TeamController { public CompletionStage<List<Team>> list() { return client.http().singleRequest(HttpRequest.create() .withUri(client.getBaseUri().addPathSegment("teams")) .withMethod(HttpMethods.GET) .addHeader(Authorization.basic(credentials.getUsername(), credentials.getPassword())), client.materializer()) .thenCompose(res -> Jackson.unmarshaller(mapper, Team[].class) .unmarshall(res.entity(), client.materializer().executionContext(), client.materializer())) .thenApply(Arrays::asList); } TeamController(Client client, Credentials credentials); CompletionStage<List<Team>> list();  }