@Test public void getMovieById() { Movie movie = _movieService.getMovieById(1548); // Star Wars Set<Tag> tags = movie.getTags(); assertNotNull("Tag set is unexpectedly null", tags); assertEquals("Number of tags", 5, tags.size()); Set<MovieCrewPerson> movieCrewPersons = movie.getMovieCrewPersons(); assertNotNull("MovieCrewPerson set is unexpectedly null", movieCrewPersons); assertEquals("Number of crew persons", 3, movieCrewPersons.size()); Set<MovieOscar> movieOscars = movie.getMovieOscars(); assertNotNull("MovieOscar set is unexpectedly null", movieOscars); assertEquals("Number of oscars", 4, movieOscars.size()); Set<MovieTyler> movieTylers = movie.getMovieTylers(); assertTrue("MovieTyler set unexpectedly not empty", CollectionUtils.isEmpty(movieTylers)); Set<ListMovie> listMovies = movie.getListMovies(); assertNotNull("ListMovie set unexpectedly null", listMovies); assertEquals("Number of lists", 1, listMovies.size()); Set<MovieLink> movieLinks = movie.getMovieLinks(); assertTrue("Movie-links-from set unexpectedly not empty", CollectionUtils.isEmpty(movieLinks)); Set<MovieSequenceMovie> sequenceMovies = movie.getMovieSequenceMovies(); assertNotNull("MovieSequenceMovie set is unexpectedly null", sequenceMovies); assertEquals("Number of sequences", 2, sequenceMovies.size()); Movie parent = movie.getParent(); assertNull("Parent movie unexpectedly not null", parent); Set<Movie> children = movie.getChildren(); assertTrue("Child movies set unexpectedly not empty", CollectionUtils.isEmpty(children)); }
@Test public void getMovieOscars() { Movie movie = _movieService.getMovieById(338); // Citizen Kane assertNotNull(movie); Set<MovieOscar> movieOscars = movie.getMovieOscars(); assertTrue(CollectionUtils.isNotEmpty(movieOscars)); assertEquals(6, movieOscars.size()); MovieOscar movieOscar = movieOscars.iterator().next(); Status status = movieOscar.getStatus(); assertNotNull(status); }