示例#1
0
 @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));
 }
示例#2
0
 @Test
 public void getMovieSequenceMovies() {
   Movie movie = _movieService.getMovieById(17); // 28 Up
   assertNotNull(movie);
   Set<MovieSequenceMovie> sequenceMovies = movie.getMovieSequenceMovies();
   assertTrue(CollectionUtils.isNotEmpty(sequenceMovies));
   assertEquals(1, sequenceMovies.size());
   // since we know there is only 1 at this point
   for (MovieSequenceMovie sequenceMovie : sequenceMovies) {
     assertEquals("The 'Up' Documentaries", sequenceMovie.getSequence().getName());
     assertEquals(4, sequenceMovie.getOrderIndex());
   }
 }