RepositoryGenerator { protected File getRepositoryFolder() { File repositoryFolder = new File(outputDirectory, REPOSITORY.value()); if (!repositoryFolder.exists()) { repositoryFolder.mkdirs(); } return repositoryFolder; } 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);  }
@Test public void getRepositoryFolderIfDoesNotExistTest() { temporaryFolder.delete(); File repositoryFolder = new File(temporaryFolder.getRoot(), REPOSITORY_FOLDER); assertThat("Repository folder already exists", !repositoryFolder.exists()); repositoryFolder = repositoryGenerator.getRepositoryFolder(); assertThat("Repository folder was not created", repositoryFolder.exists()); }
@Test public void getRepositoryFolderIfAlreadyExistsTest() throws IOException { File expectedRepositoryFolder = temporaryFolder.newFolder(REPOSITORY_FOLDER); assertThat("Repository folder does not exist", expectedRepositoryFolder.exists()); File actualRepositoryFolder = repositoryGenerator.getRepositoryFolder(); assertThat("Repository folder was modified", actualRepositoryFolder, equalTo(expectedRepositoryFolder)); }