/** * Test of getTVChanges method, of class TmdbTV. * * @throws com.omertron.themoviedbapi.MovieDbException */ @Test public void testGetTVChanges() throws MovieDbException { LOG.info("getTVChanges"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); String startDate = sdf.format(DateUtils.addDays(new Date(), -14)); String endDate = ""; int maxCheck = 5; TmdbChanges chgs = new TmdbChanges(getApiKey(), getHttpTools()); ResultList<ChangeListItem> changeList = chgs.getChangeList(MethodBase.TV, null, null, null); LOG.info( "Found {} changes to check, will check maximum of {}", changeList.getResults().size(), maxCheck); int count = 1; ResultList<ChangeKeyItem> result; for (ChangeListItem item : changeList.getResults()) { result = instance.getTVChanges(item.getId(), startDate, endDate); for (ChangeKeyItem ci : result.getResults()) { assertNotNull("Null changes", ci); } if (count++ > maxCheck) { break; } } }
/** * Test of getTVContentRatings method, of class TmdbTV. * * @throws com.omertron.themoviedbapi.MovieDbException */ @Test public void testGetTVContentRatings() throws MovieDbException { LOG.info("getTVContentRatings"); for (TestID test : TV_IDS) { ResultList<ContentRating> result = instance.getTVContentRatings(test.getTmdb()); TestSuite.test(result, "TV Content Rating"); assertTrue("No language", StringUtils.isNotBlank(result.getResults().get(0).getCountry())); assertTrue("No rating", StringUtils.isNotBlank(result.getResults().get(0).getRating())); } }
/** * Test of getTVImages method, of class TmdbTV. * * @throws com.omertron.themoviedbapi.MovieDbException */ @Test public void testGetTVImages() throws MovieDbException { LOG.info("getTVImages"); String language = LANGUAGE_DEFAULT; String[] includeImageLanguage = null; ArtworkResults results = new ArtworkResults(); for (TestID test : TV_IDS) { ResultList<Artwork> result = instance.getTVImages(test.getTmdb(), language, includeImageLanguage); TestSuite.test(result, "TV Images"); for (Artwork artwork : result.getResults()) { results.found(artwork.getArtworkType()); } // We should only have posters & backdrops results.validateResults(ArtworkType.POSTER, ArtworkType.BACKDROP); } }