ImdbInfo { public String getImdbId(String movieName, String year) { return getImdbId(movieName, year, CATEGORY_ALL); } ImdbInfo(); String getImdbId(String movieName, String year); String getImdbId(String movieName, String year, boolean isTVShow); String getImdbPersonId(String personName, String movieId); String getImdbPersonId(String personName); String getImdbSite(); Charset getCharset();  }
@Test public void testImdbMovieId_VariableOff() { LOG.info("testImdbMovieId_VariableOff"); for (String site : SITES) { PropertiesUtil.setProperty("imdb.site", site); PropertiesUtil.setProperty("imdb.id.search.match", "first"); PropertiesUtil.setProperty("imdb.id.search.variable", false); ImdbInfo imdbInfo = new ImdbInfo(); String id = imdbInfo.getImdbId("Abraham Lincoln Vampire Hunter", null, false); assertNotEquals("IMDb site " + site, "tt1611224", id); } }
@Test public void testImdbMovieId_VariableOn() { LOG.info("testImdbMovieId_VariableOn"); for (String site : SITES) { PropertiesUtil.setProperty("imdb.site", site); PropertiesUtil.setProperty("imdb.id.search.match", "first"); PropertiesUtil.setProperty("imdb.id.search.variable", true); ImdbInfo imdbInfo = new ImdbInfo(); String id = imdbInfo.getImdbId("Abraham Lincoln Vampire Hunter", null, false); assertEquals("IMDb site " + site, "tt1611224", id); } }
@Test public void testImdbMovieIdFirstMatch() { LOG.info("testImdbMovieIdFirstMatch"); for (String site : SITES) { PropertiesUtil.setProperty("imdb.site", site); PropertiesUtil.setProperty("imdb.id.search.match", "first"); PropertiesUtil.setProperty("imdb.id.search.variable", false); ImdbInfo imdbInfo = new ImdbInfo(); String id = imdbInfo.getImdbId("Avatar", "2009", false); assertEquals("IMDb site " + site, "tt0499549", id); } }
@Test public void testImdbMovieIdRegularMatch() { LOG.info("testImdbMovieIdRegularMatch"); for (String site : SITES) { PropertiesUtil.setProperty("imdb.site", site); PropertiesUtil.setProperty("imdb.id.search.match", "regular"); PropertiesUtil.setProperty("imdb.id.search.variable", false); ImdbInfo imdbInfo = new ImdbInfo(); String id = imdbInfo.getImdbId("Avatar", "2009", false); assertEquals("IMDb site " + site, "tt0499549", id); } }
@Test public void testImdbMovieIdExactMatch() { LOG.info("testImdbMovieIdExactMatch"); for (String site : SITES) { PropertiesUtil.setProperty("imdb.site", site); PropertiesUtil.setProperty("imdb.id.search.match", "exact"); PropertiesUtil.setProperty("imdb.id.search.variable", true); ImdbInfo imdbInfo = new ImdbInfo(); String id = imdbInfo.getImdbId("Avatar", "2009", false); assertEquals("IMDb site " + site, "tt0499549", id); } }