@Test public void installArtifactsTest() throws IOException { File repositoryFolder = temporaryFolder.getRoot(); buildArtifacts(); when(appModelMock.getArtifacts()).thenReturn(artifacts); repositoryGeneratorSpy.installArtifacts(repositoryFolder, artifactInstallerMock, appModelMock, true); verify(repositoryGeneratorSpy, times(0)).generateMarkerFileInRepositoryFolder(repositoryFolder); verify(artifactInstallerMock, times(NUMBER_ARTIFACTS)).installArtifact(any(), any(), any(), eq(true)); }
protected void installArtifacts(File repositoryFile, ArtifactInstaller installer, ApplicationClassloaderModel appModel, boolean prettyPrinting) throws IOException { Map<ArtifactCoordinates, ClassLoaderModel> mulePluginsClassloaderModels = appModel.getMulePluginsClassloaderModels().stream() .collect(Collectors.toMap(ClassLoaderModel::getArtifactCoordinates, Function.identity())); TreeSet<Artifact> sortedArtifacts = new TreeSet<>(removeProvidedArtifacts(appModel.getArtifacts())); if (sortedArtifacts.isEmpty()) { generateMarkerFileInRepositoryFolder(repositoryFile); } for (Artifact artifact : sortedArtifacts) { Optional<ClassLoaderModel> classLoaderModelOptional = Optional.ofNullable(mulePluginsClassloaderModels.get(artifact.getArtifactCoordinates())); installer.installArtifact(repositoryFile, artifact, classLoaderModelOptional, prettyPrinting); } }
RepositoryGenerator { protected void installArtifacts(File repositoryFile, ArtifactInstaller installer, ApplicationClassloaderModel appModel, boolean prettyPrinting) throws IOException { Map<ArtifactCoordinates, ClassLoaderModel> mulePluginsClassloaderModels = appModel.getMulePluginsClassloaderModels().stream() .collect(Collectors.toMap(ClassLoaderModel::getArtifactCoordinates, Function.identity())); TreeSet<Artifact> sortedArtifacts = new TreeSet<>(removeProvidedArtifacts(appModel.getArtifacts())); if (sortedArtifacts.isEmpty()) { generateMarkerFileInRepositoryFolder(repositoryFile); } for (Artifact artifact : sortedArtifacts) { Optional<ClassLoaderModel> classLoaderModelOptional = Optional.ofNullable(mulePluginsClassloaderModels.get(artifact.getArtifactCoordinates())); installer.installArtifact(repositoryFile, artifact, classLoaderModelOptional, prettyPrinting); } } }
RepositoryGenerator { protected void installArtifacts(File repositoryFile, ArtifactInstaller installer, ApplicationClassloaderModel appModel, boolean prettyPrinting) throws IOException { Map<ArtifactCoordinates, ClassLoaderModel> mulePluginsClassloaderModels = appModel.getMulePluginsClassloaderModels().stream() .collect(Collectors.toMap(ClassLoaderModel::getArtifactCoordinates, Function.identity())); TreeSet<Artifact> sortedArtifacts = new TreeSet<>(removeProvidedArtifacts(appModel.getArtifacts())); if (sortedArtifacts.isEmpty()) { generateMarkerFileInRepositoryFolder(repositoryFile); } for (Artifact artifact : sortedArtifacts) { Optional<ClassLoaderModel> classLoaderModelOptional = Optional.ofNullable(mulePluginsClassloaderModels.get(artifact.getArtifactCoordinates())); installer.installArtifact(repositoryFile, artifact, classLoaderModelOptional, prettyPrinting); } } RepositoryGenerator(File projectPomFile, File outputDirectory, ArtifactInstaller artifactInstaller,
                             ApplicationClassLoaderModelAssembler applicationClassLoaderModelAssembler,
                             ApplicationGAVModel appGAVModel); }
RepositoryGenerator { protected void installArtifacts(File repositoryFile, ArtifactInstaller installer, ApplicationClassloaderModel appModel, boolean prettyPrinting) throws IOException { Map<ArtifactCoordinates, ClassLoaderModel> mulePluginsClassloaderModels = appModel.getMulePluginsClassloaderModels().stream() .collect(Collectors.toMap(ClassLoaderModel::getArtifactCoordinates, Function.identity())); TreeSet<Artifact> sortedArtifacts = new TreeSet<>(removeProvidedArtifacts(appModel.getArtifacts())); if (sortedArtifacts.isEmpty()) { generateMarkerFileInRepositoryFolder(repositoryFile); } for (Artifact artifact : sortedArtifacts) { Optional<ClassLoaderModel> classLoaderModelOptional = Optional.ofNullable(mulePluginsClassloaderModels.get(artifact.getArtifactCoordinates())); installer.installArtifact(repositoryFile, artifact, classLoaderModelOptional, prettyPrinting); } } RepositoryGenerator(File projectPomFile, File outputDirectory, ArtifactInstaller artifactInstaller,
                             ApplicationClassLoaderModelAssembler applicationClassLoaderModelAssembler,
                             ApplicationGAVModel appGAVModel); @Deprecated ClassLoaderModel generate(); @Deprecated ClassLoaderModel generate(boolean lightweight, boolean useLocalRepository, boolean prettyPrinting,
                                   boolean includeTestDependencies); ClassLoaderModel generate(boolean lightweight, boolean useLocalRepository, boolean prettyPrinting,
                                   boolean includeTestDependencies, Optional<MavenReactorResolver> mavenReactorResolver); @Deprecated ClassLoaderModel generate(boolean lightweight); }
RepositoryGenerator { protected void installArtifacts(File repositoryFile, ArtifactInstaller installer, ApplicationClassloaderModel appModel, boolean prettyPrinting) throws IOException { Map<ArtifactCoordinates, ClassLoaderModel> mulePluginsClassloaderModels = appModel.getMulePluginsClassloaderModels().stream() .collect(Collectors.toMap(ClassLoaderModel::getArtifactCoordinates, Function.identity())); TreeSet<Artifact> sortedArtifacts = new TreeSet<>(removeProvidedArtifacts(appModel.getArtifacts())); if (sortedArtifacts.isEmpty()) { generateMarkerFileInRepositoryFolder(repositoryFile); } for (Artifact artifact : sortedArtifacts) { Optional<ClassLoaderModel> classLoaderModelOptional = Optional.ofNullable(mulePluginsClassloaderModels.get(artifact.getArtifactCoordinates())); installer.installArtifact(repositoryFile, artifact, classLoaderModelOptional, prettyPrinting); } } RepositoryGenerator(File projectPomFile, File outputDirectory, ArtifactInstaller artifactInstaller,
                             ApplicationClassLoaderModelAssembler applicationClassLoaderModelAssembler,
                             ApplicationGAVModel appGAVModel); @Deprecated ClassLoaderModel generate(); @Deprecated ClassLoaderModel generate(boolean lightweight, boolean useLocalRepository, boolean prettyPrinting,
                                   boolean includeTestDependencies); ClassLoaderModel generate(boolean lightweight, boolean useLocalRepository, boolean prettyPrinting,
                                   boolean includeTestDependencies, Optional<MavenReactorResolver> mavenReactorResolver); @Deprecated ClassLoaderModel generate(boolean lightweight);  }