@Test public void repoConfigurationHasOriginAndAvoidIndex() throws Exception { service.importProjects(target); verify(repoService).createRepository(any(), any(), any(), configsCaptor.capture()); RepositoryEnvironmentConfigurations configs = configsCaptor.getValue(); assertEquals(target.toUri().toString(), assertValue(configs.getOrigin(), String.class)); assertEquals("true", configs.getConfigurationMap().get(AVOID_INDEX)); }
public void importProjects(Path actualTarget) { OrganizationalUnit ou = ouService.createOrganizationalUnit(OU_NAME, "org.migration", Collections.emptyList(), Collections.singletonList(new Contributor(OU_OWNER, ContributorType.OWNER))); String repositoryURL = actualTarget.toUri().toString(); RepositoryEnvironmentConfigurations configurations = new RepositoryEnvironmentConfigurations(); Map<String, Object> configMap = configurations.getConfigurationMap(); configMap.put(EnvironmentParameters.AVOID_INDEX, "true"); configMap.put("origin", repositoryURL); Repository repo = repoService.createRepository(ou, GitRepository.SCHEME.toString(), TMP_REPO_ALIAS, configurations); WorkspaceProject project = projectService.resolveProject(repo); migrationService.migrate(project); repoService.removeRepository(ou.getSpace(), TMP_REPO_ALIAS); }
TemporaryNiogitService { public void importProjects(Path actualTarget) { OrganizationalUnit ou = ouService.createOrganizationalUnit(OU_NAME, "org.migration", Collections.emptyList(), Collections.singletonList(new Contributor(OU_OWNER, ContributorType.OWNER))); String repositoryURL = actualTarget.toUri().toString(); RepositoryEnvironmentConfigurations configurations = new RepositoryEnvironmentConfigurations(); Map<String, Object> configMap = configurations.getConfigurationMap(); configMap.put(EnvironmentParameters.AVOID_INDEX, "true"); configMap.put("origin", repositoryURL); Repository repo = repoService.createRepository(ou, GitRepository.SCHEME.toString(), TMP_REPO_ALIAS, configurations); WorkspaceProject project = projectService.resolveProject(repo); migrationService.migrate(project); repoService.removeRepository(ou.getSpace(), TMP_REPO_ALIAS); } }
TemporaryNiogitService { public void importProjects(Path actualTarget) { OrganizationalUnit ou = ouService.createOrganizationalUnit(OU_NAME, "org.migration", Collections.emptyList(), Collections.singletonList(new Contributor(OU_OWNER, ContributorType.OWNER))); String repositoryURL = actualTarget.toUri().toString(); RepositoryEnvironmentConfigurations configurations = new RepositoryEnvironmentConfigurations(); Map<String, Object> configMap = configurations.getConfigurationMap(); configMap.put(EnvironmentParameters.AVOID_INDEX, "true"); configMap.put("origin", repositoryURL); Repository repo = repoService.createRepository(ou, GitRepository.SCHEME.toString(), TMP_REPO_ALIAS, configurations); WorkspaceProject project = projectService.resolveProject(repo); migrationService.migrate(project); repoService.removeRepository(ou.getSpace(), TMP_REPO_ALIAS); } @Inject  TemporaryNiogitService(OrganizationalUnitService ouService,
                                  RepositoryService repoService,
                                  WorkspaceProjectService projectService,
                                  WorkspaceProjectMigrationService migrationService); }
TemporaryNiogitService { public void importProjects(Path actualTarget) { OrganizationalUnit ou = ouService.createOrganizationalUnit(OU_NAME, "org.migration", Collections.emptyList(), Collections.singletonList(new Contributor(OU_OWNER, ContributorType.OWNER))); String repositoryURL = actualTarget.toUri().toString(); RepositoryEnvironmentConfigurations configurations = new RepositoryEnvironmentConfigurations(); Map<String, Object> configMap = configurations.getConfigurationMap(); configMap.put(EnvironmentParameters.AVOID_INDEX, "true"); configMap.put("origin", repositoryURL); Repository repo = repoService.createRepository(ou, GitRepository.SCHEME.toString(), TMP_REPO_ALIAS, configurations); WorkspaceProject project = projectService.resolveProject(repo); migrationService.migrate(project); repoService.removeRepository(ou.getSpace(), TMP_REPO_ALIAS); } @Inject  TemporaryNiogitService(OrganizationalUnitService ouService,
                                  RepositoryService repoService,
                                  WorkspaceProjectService projectService,
                                  WorkspaceProjectMigrationService migrationService); void importProjects(Path actualTarget); }
TemporaryNiogitService { public void importProjects(Path actualTarget) { OrganizationalUnit ou = ouService.createOrganizationalUnit(OU_NAME, "org.migration", Collections.emptyList(), Collections.singletonList(new Contributor(OU_OWNER, ContributorType.OWNER))); String repositoryURL = actualTarget.toUri().toString(); RepositoryEnvironmentConfigurations configurations = new RepositoryEnvironmentConfigurations(); Map<String, Object> configMap = configurations.getConfigurationMap(); configMap.put(EnvironmentParameters.AVOID_INDEX, "true"); configMap.put("origin", repositoryURL); Repository repo = repoService.createRepository(ou, GitRepository.SCHEME.toString(), TMP_REPO_ALIAS, configurations); WorkspaceProject project = projectService.resolveProject(repo); migrationService.migrate(project); repoService.removeRepository(ou.getSpace(), TMP_REPO_ALIAS); } @Inject  TemporaryNiogitService(OrganizationalUnitService ouService,
                                  RepositoryService repoService,
                                  WorkspaceProjectService projectService,
                                  WorkspaceProjectMigrationService migrationService); void importProjects(Path actualTarget);  }