MovieMeterPosterPlugin extends AbstractMoviePosterPlugin { @Override public IImage getPosterUrl(String id) { if (!StringUtils.isNumeric(id)) { return Image.UNKNOWN; } String posterURL = Movie.UNKNOWN; FilmInfo filmInfo; try { filmInfo = api.getFilm(NumberUtils.toInt(id)); if (filmInfo.getPosters() == null || filmInfo.getPosters().getLarge() == null) { LOG.debug("No MovieMeter Poster URL for movie: {}", id); } else { posterURL = filmInfo.getPosters().getLarge(); } } catch (MovieMeterException ex) { LOG.error("Failed retreiving MovieMeter Poster URL for movie: {}", id); LOG.error(SystemTools.getStackTrace(ex)); } if (StringTools.isValidString(posterURL)) { return new Image(posterURL); } return Image.UNKNOWN; } MovieMeterPosterPlugin(); @Override String getIdFromMovieInfo(String title, String year); @Override IImage getPosterUrl(String id); @Override IImage getPosterUrl(String title, String year); @Override String getName();  }
@Test public void testGetPosterUrl_String() { LOG.info("getPosterUrl (ID)"); for (TestData td : testData) { IImage result = plugin.getPosterUrl(td.id); assertTrue("No image returned", StringTools.isValidString(result.getUrl())); } }