@Test(expected = IOException.class) public void exception() throws IOException { when(keySupplier.get()).thenReturn(KEY); doThrow(IOException.class).when(outputStreamFactory).apply(KEY); underTest.performBackup(); }
@Scheduled(cron = "0 0 * * * *") void performBackup() throws IOException { log.info("Starting backup."); try (OutputStream output = outputStreamFactory.apply(keySupplier.get())) { mapper.writeValue(output, store); } log.info("Backup completed."); }
Towtruck { @Scheduled(cron = "0 0 * * * *") void performBackup() throws IOException { log.info("Starting backup."); try (OutputStream output = outputStreamFactory.apply(keySupplier.get())) { mapper.writeValue(output, store); } log.info("Backup completed."); } }
Towtruck { @Scheduled(cron = "0 0 * * * *") void performBackup() throws IOException { log.info("Starting backup."); try (OutputStream output = outputStreamFactory.apply(keySupplier.get())) { mapper.writeValue(output, store); } log.info("Backup completed."); }  }
Towtruck { @Scheduled(cron = "0 0 * * * *") void performBackup() throws IOException { log.info("Starting backup."); try (OutputStream output = outputStreamFactory.apply(keySupplier.get())) { mapper.writeValue(output, store); } log.info("Backup completed."); }   }
Towtruck { @Scheduled(cron = "0 0 * * * *") void performBackup() throws IOException { log.info("Starting backup."); try (OutputStream output = outputStreamFactory.apply(keySupplier.get())) { mapper.writeValue(output, store); } log.info("Backup completed."); }    }