@Test(expected = ArchiveExportException.class)
  public void testExportThrowsArchiveExceptionOnAssetWriteFailure() throws IOException {
    log.info("testExportThrowsArchiveExceptionOnAssetWriteFailure");
    Archive<?> archive = createArchiveWithAssets();

    // Check if a the path already contains a node so we remove it from the parent's children
    if (archive.contains(PATH_ONE)) {
      archive.delete(PATH_ONE);
    }

    archive.add(
        new Asset() {
          @Override
          public InputStream openStream() {
            throw new RuntimeException("Mock Exception from an Asset write");
          }
        },
        PATH_ONE);

    // Export
    final InputStream in = this.exportAsInputStream(archive);

    // Read in the full content (to in turn empty the underlying buffer and ensure we complete)
    final OutputStream sink =
        new OutputStream() {
          @Override
          public void write(int b) throws IOException {}
        };
    IOUtil.copyWithClose(in, sink);
  }
  protected File export(Archive<?> archive) throws Exception {
    if (archive instanceof WebArchive == false) {
      throw new IllegalArgumentException("Can only handle .war deployments: " + archive);
    }

    Node dockerFile = archive.get("Dockerfile");
    if (dockerFile == null) {
      if (configuration.getFrom() == null) {
        throw new IllegalArgumentException("Missing Docker's FROM value!");
      }

      log.info("Using Docker FROM: " + configuration.getFrom());

      String content = "FROM " + configuration.getFrom() + "\n" + "ADD . /app" + "\n";
      archive.add(new StringAsset(content), "Dockerfile");
    }

    return super.export(archive);
  }