@Test(expectedExceptions = IOException.class) public void testProcessResultsHasExceptionsAndThrows() throws IOException { ResultsProcessor.processResults(new ArrayList<>(), Collections.singletonList(new IOException("test")), LoggerFactory.getLogger(ResultsProcessorTest.class)); }
public static void processResults(List<String> skippedRepos, List<IOException> exceptions, Logger logger) throws IOException { if (!skippedRepos.isEmpty()) { logger.info(REPOS_SKIPPED_MESSAGE, skippedRepos); } if (!exceptions.isEmpty()) { throw new IOException(String.format("There were %s errors with changing Dockerfiles.", exceptions.size())); } }
ResultsProcessor { public static void processResults(List<String> skippedRepos, List<IOException> exceptions, Logger logger) throws IOException { if (!skippedRepos.isEmpty()) { logger.info(REPOS_SKIPPED_MESSAGE, skippedRepos); } if (!exceptions.isEmpty()) { throw new IOException(String.format("There were %s errors with changing Dockerfiles.", exceptions.size())); } } }
ResultsProcessor { public static void processResults(List<String> skippedRepos, List<IOException> exceptions, Logger logger) throws IOException { if (!skippedRepos.isEmpty()) { logger.info(REPOS_SKIPPED_MESSAGE, skippedRepos); } if (!exceptions.isEmpty()) { throw new IOException(String.format("There were %s errors with changing Dockerfiles.", exceptions.size())); } }  }
ResultsProcessor { public static void processResults(List<String> skippedRepos, List<IOException> exceptions, Logger logger) throws IOException { if (!skippedRepos.isEmpty()) { logger.info(REPOS_SKIPPED_MESSAGE, skippedRepos); } if (!exceptions.isEmpty()) { throw new IOException(String.format("There were %s errors with changing Dockerfiles.", exceptions.size())); } }  static void processResults(List<String> skippedRepos, List<IOException> exceptions, Logger logger); }
ResultsProcessor { public static void processResults(List<String> skippedRepos, List<IOException> exceptions, Logger logger) throws IOException { if (!skippedRepos.isEmpty()) { logger.info(REPOS_SKIPPED_MESSAGE, skippedRepos); } if (!exceptions.isEmpty()) { throw new IOException(String.format("There were %s errors with changing Dockerfiles.", exceptions.size())); } }  static void processResults(List<String> skippedRepos, List<IOException> exceptions, Logger logger); static final String REPOS_SKIPPED_MESSAGE; }