@Test public void getAllMovies() { final WebTarget target = ClientBuilder.newClient().target(serverURI); final Movie[] movies = target.path("/api/movies").request().get(Movie[].class); assertEquals(6, movies.length); final Movie movie = movies[1]; assertEquals("Todd Phillips", movie.getDirector()); assertEquals("Starsky & Hutch", movie.getTitle()); assertEquals("Action", movie.getGenre()); assertEquals(2004, movie.getYear()); assertEquals(2, movie.getId()); }
@GET public List<Movie> getAllMovies() { return new ArrayList<>(store.values()); }
MovieService { @GET public List<Movie> getAllMovies() { return new ArrayList<>(store.values()); } }
MovieService { @GET public List<Movie> getAllMovies() { return new ArrayList<>(store.values()); }  }
MovieService { @GET public List<Movie> getAllMovies() { return new ArrayList<>(store.values()); }  @PostConstruct void construct(); @GET List<Movie> getAllMovies(); @POST Movie addMovie(final Movie newMovie); }
MovieService { @GET public List<Movie> getAllMovies() { return new ArrayList<>(store.values()); }  @PostConstruct void construct(); @GET List<Movie> getAllMovies(); @POST Movie addMovie(final Movie newMovie);  }