@Test public void testGetAllPosts() throws Exception { String path = "/posts"; WebTarget targetGetAll = client.target(URI.create("http: try (Response resGetAll = targetGetAll.request().accept(MediaType.APPLICATION_JSON_TYPE).get()) { assertEquals(200, resGetAll.getStatus()); List<Post> results = resGetAll.readEntity(new GenericType<List<Post>>() { }); assertTrue(results != null); LOGGER.info("results.size()::" + results.size()); assertTrue(results.size() == 2); } }
private void getAllPosts(ServerRequest serverRequest, ServerResponse serverResponse) { serverResponse.send(EntityUtils.toJsonArray(this.posts.all())); }
PostService implements Service { private void getAllPosts(ServerRequest serverRequest, ServerResponse serverResponse) { serverResponse.send(EntityUtils.toJsonArray(this.posts.all())); } }
PostService implements Service { private void getAllPosts(ServerRequest serverRequest, ServerResponse serverResponse) { serverResponse.send(EntityUtils.toJsonArray(this.posts.all())); } PostService(PostRepository posts); }
PostService implements Service { private void getAllPosts(ServerRequest serverRequest, ServerResponse serverResponse) { serverResponse.send(EntityUtils.toJsonArray(this.posts.all())); } PostService(PostRepository posts); @Override void update(Routing.Rules rules); }
PostService implements Service { private void getAllPosts(ServerRequest serverRequest, ServerResponse serverResponse) { serverResponse.send(EntityUtils.toJsonArray(this.posts.all())); } PostService(PostRepository posts); @Override void update(Routing.Rules rules);  }