@Test
public void badInputZipStrStr() throws Exception {

  File destFile = new File(destDir, "badInputStrStr.zip");
  try {
    // Null input filenames array, correct destination filename
    try {
      ZipUtil.zip((String[]) null, destFile.getCanonicalPath(), true, ZipUtil.NO_COMPRESSION);
      logger.error("Zip should fail when input String array is null");
      Assert.fail("Zip should fail when input String array is null");
    } catch (IllegalArgumentException e) {
      logger.debug("Detecting null input String array (String, String): OK");
    }
    // Null some of the input filenames, correct destination filename
    try {
      ZipUtil.zip(new String[] { srcFile.getCanonicalPath(), null, nestedSrcFile.getCanonicalPath() },
              destFile.getCanonicalPath(), true, ZipUtil.NO_COMPRESSION);
      logger.error("Zip should fail when any input filename is null");
      Assert.fail("Zip should fail when any input filename is null");
    } catch (IllegalArgumentException e) {
      logger.debug("Detecting null input filename (String, String): OK");
    }
    // Non-existing some of the input filenames, correct destination filename
    try {
      ZipUtil.zip(
              new String[] { srcFile.getCanonicalPath(), dummieFile.getCanonicalPath(),
                      nestedSrcFile.getCanonicalPath() }, destFile.getCanonicalPath(), true, ZipUtil.NO_COMPRESSION);
      logger.error("Zip should fail when any input filename does not exist");
      Assert.fail("Zip should fail when any input filename does not exist");
    } catch (FileNotFoundException e) {
      logger.debug("Detecting non-existing input filename (String, String): OK");
    }
    // Correct input filenames array, null destination filename
    try {
      ZipUtil.zip(new String[] { srcFile.getCanonicalPath(), nestedSrcFile.getCanonicalPath() }, (String) null, true,
              ZipUtil.NO_COMPRESSION);
      logger.error("Zip should fail when destination filename is null");
      Assert.fail("Zip should fail when destination filename is null");
    } catch (IllegalArgumentException e) {
      logger.debug("Detecting null destination filename (String, String): OK");
    }
    // Correct input filenames array, empty destination filename
    try {
      ZipUtil.zip(new String[] { srcFile.getCanonicalPath(), nestedSrcFile.getCanonicalPath() }, "", true,
              ZipUtil.NO_COMPRESSION);
      logger.error("Zip should fail when destination filename is empty");
      Assert.fail("Zip should fail when destination filename is empty");
    } catch (IllegalArgumentException e) {
      logger.debug("Detecting empty destination filename (String, String): OK");
    }
    // Correct input filenames, existing destination filename
    try {
      ZipUtil.zip(new String[] { srcFile.getCanonicalPath(), nestedSrcFile.getCanonicalPath() },
              sampleZip.getCanonicalPath(), true, ZipUtil.NO_COMPRESSION);
      logger.error("Zip should fail when destination filename already exists");
      Assert.fail("Zip should fail when destination filename already exists");
    } catch (IllegalArgumentException e) {
      logger.debug("Detecting existing destination filename (String, String): OK");
    }
    // Correct input filenames, invalid name for the zip file
    try {
      ZipUtil.zip(new String[] { srcFile.getCanonicalPath(), nestedSrcFile.getCanonicalPath() },
              dummieFile.getCanonicalPath(), true, ZipUtil.NO_COMPRESSION);
      logger.error("Zip should fail when the destination filename does not represent a zip file");
      Assert.fail("Zip should fail when the destination filename does not represent a zip file");
    } catch (IllegalArgumentException e) {
      logger.debug("Detecting destination filename not representing a valid zip file (String, String): OK");
    }
  } catch (Exception e) {
    logger.error("Another exception was expected, but got {} instead: {}", e.getClass().getName(), e.getMessage());
    Assert.fail("Another exception was expected, but got " + e.getClass().getName() + " instead: " + e.getMessage());
  }
}