MaintenancePlugin extends PluginBase { public File zipLogs(File zipFile, List<File> files) { LOG.debug("creating zip {}", zipFile.getAbsolutePath()); try { zip(zipFile, files); } catch (IOException e) { LOG.error("Cannot retrieve zip", e); } return zipFile; } MaintenancePlugin();   MaintenancePlugin(Context ctx); static MaintenancePlugin getPlugin(); static MaintenancePlugin initPlugin(Context ctx); void sendLogs(); void deleteLogs(); List<File> getLogfiles(String directory, int amount); File zipLogs(File zipFile, List<File> files); String constructName(); void zip(File zipFile, List<File> files); static Intent sendMail(Uri attachementUri, String recipient, String subject); static Intent sendMail(Uri attachementUri, String recipient, String subject, String body);  }
@Test public void zipLogsTest() { String logDirectory = "src/test/res/logger"; List<File> logs = sut.getLogfiles(logDirectory, 2); String name = "AndroidAPS.log.zip"; File zipFile = new File("build/" + name); zipFile = sut.zipLogs(zipFile, logs); assertTrue(zipFile.exists()); assertTrue(zipFile.isFile()); }