OverrideTools { public static boolean checkOverwriteRuntime(Movie movie, String source) { if (skipCheck(movie, OverrideFlag.RUNTIME, source)) { return Boolean.FALSE; } else if (StringTools.isNotValidString(movie.getRuntime())) { return Boolean.TRUE; } return checkOverwrite(movie, OverrideFlag.RUNTIME, source); } private  OverrideTools(); static void putMoviePriorities(OverrideFlag overrideFlag, String sources); static void putTvPriorities(OverrideFlag overrideFlag, String sources); static void putMoviePersonPriorities(OverrideFlag overrideFlag, String sources); static void putTvPersonPriorities(OverrideFlag overrideFlag, String sources); static boolean checkOneOverwrite(Movie movie, String source, OverrideFlag... overrideFlags); static boolean checkOverwriteActors(Movie movie, String source); static boolean checkOverwriteAspectRatio(Movie movie, String source); static boolean checkOverwriteCertification(Movie movie, String source); static boolean checkOverwriteCompany(Movie movie, String source); static boolean checkOverwriteContainer(Movie movie, String source); static boolean checkOverwriteCountry(Movie movie, String source); static boolean checkOverwriteDirectors(Movie movie, String source); static boolean checkOverwriteGenres(Movie movie, String source); static boolean checkOverwriteFPS(Movie movie, String source); static boolean checkOverwriteLanguage(Movie movie, String source); static boolean checkOverwriteOriginalTitle(Movie movie, String source); static boolean checkOverwriteOutline(Movie movie, String source); static boolean checkOverwritePlot(Movie movie, String source); static boolean checkOverwriteQuote(Movie movie, String source); static boolean checkOverwriteReleaseDate(Movie movie, String source); static boolean checkOverwriteResolution(Movie movie, String source); static boolean checkOverwriteRuntime(Movie movie, String source); static boolean checkOverwriteTagline(Movie movie, String source); static boolean checkOverwriteTitle(Movie movie, String source); static boolean checkOverwriteTop250(Movie movie, String source); static boolean checkOverwriteVideoOutput(Movie movie, String source); static boolean checkOverwriteVideoSource(Movie movie, String source); static boolean checkOverwriteWriters(Movie movie, String source); static boolean checkOverwriteYear(Movie movie, String source); static boolean checkOverwritePeopleActors(Movie movie, String source); static boolean checkOverwritePeopleDirectors(Movie movie, String source); static boolean checkOverwritePeopleWriters(Movie movie, String source); static boolean checkOverwriteEpisodeFirstAired(MovieFile movieFile, int part, String source); static boolean checkOverwriteEpisodePlot(MovieFile movieFile, int part, String source); static boolean checkOverwriteEpisodeRating(MovieFile movieFile, int part, String source); static boolean checkOverwriteEpisodeTitle(MovieFile movieFile, int part, String source);  }
@Test public void testPriority1() { LOG.info("Priority1"); Movie movie = new Movie(); if (OverrideTools.checkOverwriteRuntime(movie, Movie.UNKNOWN)) { movie.setRuntime("123", Movie.UNKNOWN); } assertEquals("123", movie.getRuntime()); if (OverrideTools.checkOverwriteRuntime(movie, "nfo")) { movie.setRuntime("456", "nfo"); } assertEquals("456", movie.getRuntime()); if (OverrideTools.checkOverwriteRuntime(movie, "imdb")) { movie.setRuntime("789", "imdb"); } assertEquals("456", movie.getRuntime()); }
@Test public void testPriority2() { LOG.info("Priority2"); Movie movie = new Movie(); if (OverrideTools.checkOverwriteRuntime(movie, "nfo")) { movie.setRuntime("123", "nfo"); } assertEquals("123", movie.getRuntime()); if (OverrideTools.checkOverwriteRuntime(movie, Movie.UNKNOWN)) { movie.setRuntime("456", Movie.UNKNOWN); } assertEquals("123", movie.getRuntime()); }
@Test public void testPriority3() { LOG.info("Priority3"); Movie movie = new Movie(); if (OverrideTools.checkOverwriteRuntime(movie, "nfo")) { movie.setRuntime("123", "nfo"); } assertEquals("123", movie.getRuntime()); if (OverrideTools.checkOverwriteRuntime(movie, "allocine")) { movie.setRuntime("456", "allocine"); } assertEquals("123", movie.getRuntime()); }
@Test public void testPriority4() { LOG.info("Priority4"); Movie movie = new Movie(); if (OverrideTools.checkOverwriteRuntime(movie, "imdb")) { movie.setRuntime("456", "imdb"); } assertEquals("456", movie.getRuntime()); if (OverrideTools.checkOverwriteRuntime(movie, "nfo")) { movie.setRuntime("123", "nfo"); } assertEquals("123", movie.getRuntime()); }