ZipConfigDto implements IZipConfig, Serializable { public static String getZipFileName(IZipConfig config, Date modificationDateTime) { StringBuilder zipFileName = new StringBuilder() .append(config.getZipName()) .append(getDateString(config.getDateModifiedFrom())) .append(getDateString(modificationDateTime)) .append(".zip"); return zipFileName.toString(); } ZipConfigDto(IZipConfig source); void loadFrom(IZipConfig source); static void copy(IZipConfig dest, IZipConfig source); @Override Date getDateModifiedFrom(); @Override void setDateModifiedFrom(Date dateModifiedFrom); @Override String getZipRelPath(); @Override void setZipRelPath(String zipRelPath); @Override String getZipName(); static String fixZipBaseName(String zipName); @Override void setZipName(String zipName); @Override String getZipDir(); @Override void setZipDir(String zipDir); @Override String getFilter(); @Override void setFilter(String filter); static String getZipFileName(IZipConfig config, Date modificationDateTime);  }
@Test public void getZipFileName() { Date backupStartDate = DateUtil.parseIsoDate("2017-12-06T23:59:59"); Date backupEndDate = DateUtil.parseIsoDate("2019-12-24T15:32:59"); ZipConfigDto config = new ZipConfigDto(null); config.setZipName("myResultFile"); config.setZipDir("/path/to/"); config.setDateModifiedFrom(backupStartDate); String result = ZipConfigDto.getZipFileName(config, backupEndDate); Assert.assertEquals("myResultFile.20171206-235959.20191224-153259.zip", result); }