@Test public void createPackage() throws IOException { builder.createPackage(fakeTargetFolder.getRoot().toPath(), destinationFile.toPath()); Path targetPath = fakeTargetFolder.getRoot().toPath(); verify(archiverMock, times(1)).addDomain(targetPath.resolve(DOMAIN.value()).toFile(), null, null); verify(archiverMock, times(1)).addApplications(targetPath.resolve(APPLICATIONS.value()).toFile(), null, null); verify(archiverMock, times(1)).addMaven(targetPath.resolve(META_INF.value()).resolve(MAVEN.value()).toFile(), null, null); verify(archiverMock, times(1)).setDestFile(destinationFile); verify(archiverMock, times(1)).createArchive(); }
@Override public void createPackage(Path originFolderPath, Path destinationPath) throws ArchiverException, IOException { checkArgument(originFolderPath != null, "The origin path must not be null"); checkArgument(originFolderPath.toFile().exists(), "The origin path must exist"); Path metaInfPath = originFolderPath.resolve(META_INF.value()); this.withDomain(originFolderPath.resolve(DOMAIN.value()).toFile()) .withApplications(originFolderPath.resolve(APPLICATIONS.value()).toFile()) .withMaven(metaInfPath.resolve(MAVEN.value()).toFile()); this.createArchive(destinationPath); }
DomainBundlePackageBuilder implements PackageBuilder { @Override public void createPackage(Path originFolderPath, Path destinationPath) throws ArchiverException, IOException { checkArgument(originFolderPath != null, "The origin path must not be null"); checkArgument(originFolderPath.toFile().exists(), "The origin path must exist"); Path metaInfPath = originFolderPath.resolve(META_INF.value()); this.withDomain(originFolderPath.resolve(DOMAIN.value()).toFile()) .withApplications(originFolderPath.resolve(APPLICATIONS.value()).toFile()) .withMaven(metaInfPath.resolve(MAVEN.value()).toFile()); this.createArchive(destinationPath); } }
DomainBundlePackageBuilder implements PackageBuilder { @Override public void createPackage(Path originFolderPath, Path destinationPath) throws ArchiverException, IOException { checkArgument(originFolderPath != null, "The origin path must not be null"); checkArgument(originFolderPath.toFile().exists(), "The origin path must exist"); Path metaInfPath = originFolderPath.resolve(META_INF.value()); this.withDomain(originFolderPath.resolve(DOMAIN.value()).toFile()) .withApplications(originFolderPath.resolve(APPLICATIONS.value()).toFile()) .withMaven(metaInfPath.resolve(MAVEN.value()).toFile()); this.createArchive(destinationPath); }  }
DomainBundlePackageBuilder implements PackageBuilder { @Override public void createPackage(Path originFolderPath, Path destinationPath) throws ArchiverException, IOException { checkArgument(originFolderPath != null, "The origin path must not be null"); checkArgument(originFolderPath.toFile().exists(), "The origin path must exist"); Path metaInfPath = originFolderPath.resolve(META_INF.value()); this.withDomain(originFolderPath.resolve(DOMAIN.value()).toFile()) .withApplications(originFolderPath.resolve(APPLICATIONS.value()).toFile()) .withMaven(metaInfPath.resolve(MAVEN.value()).toFile()); this.createArchive(destinationPath); }  DomainBundlePackageBuilder withMaven(File folder); DomainBundlePackageBuilder withDomain(File folder); DomainBundlePackageBuilder withApplications(File folder); DomainBundlePackageBuilder withArchiver(AbstractArchiver archiver); @Override void createPackage(Path originFolderPath, Path destinationPath); @Override void createPackage(Path destinationPath); }
DomainBundlePackageBuilder implements PackageBuilder { @Override public void createPackage(Path originFolderPath, Path destinationPath) throws ArchiverException, IOException { checkArgument(originFolderPath != null, "The origin path must not be null"); checkArgument(originFolderPath.toFile().exists(), "The origin path must exist"); Path metaInfPath = originFolderPath.resolve(META_INF.value()); this.withDomain(originFolderPath.resolve(DOMAIN.value()).toFile()) .withApplications(originFolderPath.resolve(APPLICATIONS.value()).toFile()) .withMaven(metaInfPath.resolve(MAVEN.value()).toFile()); this.createArchive(destinationPath); }  DomainBundlePackageBuilder withMaven(File folder); DomainBundlePackageBuilder withDomain(File folder); DomainBundlePackageBuilder withApplications(File folder); DomainBundlePackageBuilder withArchiver(AbstractArchiver archiver); @Override void createPackage(Path originFolderPath, Path destinationPath); @Override void createPackage(Path destinationPath);  }