@Test public void getCustomExampleProjectsTest() { System.setProperty("org.kie.project.examples.repository.url", "importProjectsUrl"); final Set<ImportProject> importProjects = new HashSet<>(); importProjects.add(mock(ImportProject.class)); doReturn(importProjects).when(examplesService).getProjects(any(), eq(new ExampleRepository("importProjectsUrl"))); final Set<ImportProject> loadedImportProjects = libraryService.getExampleProjects(mock(OrganizationalUnit.class)); assertEquals(importProjects, loadedImportProjects); }
@Override public Set<ImportProject> getExampleProjects(OrganizationalUnit organizationalUnit) { final String importProjectsUrl = getCustomImportProjectsUrl(); final ExampleRepository repository = importProjectsUrl == null || importProjectsUrl.isEmpty() ? examplesService.getPlaygroundRepository() : new ExampleRepository(importProjectsUrl); final Set<ImportProject> projects = examplesService.getProjects(organizationalUnit, repository); return projects; }
LibraryServiceImpl implements LibraryService { @Override public Set<ImportProject> getExampleProjects(OrganizationalUnit organizationalUnit) { final String importProjectsUrl = getCustomImportProjectsUrl(); final ExampleRepository repository = importProjectsUrl == null || importProjectsUrl.isEmpty() ? examplesService.getPlaygroundRepository() : new ExampleRepository(importProjectsUrl); final Set<ImportProject> projects = examplesService.getProjects(organizationalUnit, repository); return projects; } }
LibraryServiceImpl implements LibraryService { @Override public Set<ImportProject> getExampleProjects(OrganizationalUnit organizationalUnit) { final String importProjectsUrl = getCustomImportProjectsUrl(); final ExampleRepository repository = importProjectsUrl == null || importProjectsUrl.isEmpty() ? examplesService.getPlaygroundRepository() : new ExampleRepository(importProjectsUrl); final Set<ImportProject> projects = examplesService.getProjects(organizationalUnit, repository); return projects; } LibraryServiceImpl(); @Inject  LibraryServiceImpl(final OrganizationalUnitService ouService,
                              final RefactoringQueryService refactoringQueryService,
                              final LibraryPreferences preferences,
                              final AuthorizationManager authorizationManager,
                              final SessionInfo sessionInfo,
                              final ExplorerServiceHelper explorerServiceHelper,
                              final WorkspaceProjectService projectService,
                              final KieModuleService moduleService,
                              final ExamplesService examplesService,
                              @Named("ioStrategy") final IOService ioService,
                              final UserManagerService userManagerService,
                              final IndexStatusOracle indexOracle,
                              final SpaceConfigStorageRegistry spaceConfigStorageRegistry,
                              final ClusterService clusterService,
                              final ArchetypeService archetypeService); }
LibraryServiceImpl implements LibraryService { @Override public Set<ImportProject> getExampleProjects(OrganizationalUnit organizationalUnit) { final String importProjectsUrl = getCustomImportProjectsUrl(); final ExampleRepository repository = importProjectsUrl == null || importProjectsUrl.isEmpty() ? examplesService.getPlaygroundRepository() : new ExampleRepository(importProjectsUrl); final Set<ImportProject> projects = examplesService.getProjects(organizationalUnit, repository); return projects; } LibraryServiceImpl(); @Inject  LibraryServiceImpl(final OrganizationalUnitService ouService,
                              final RefactoringQueryService refactoringQueryService,
                              final LibraryPreferences preferences,
                              final AuthorizationManager authorizationManager,
                              final SessionInfo sessionInfo,
                              final ExplorerServiceHelper explorerServiceHelper,
                              final WorkspaceProjectService projectService,
                              final KieModuleService moduleService,
                              final ExamplesService examplesService,
                              @Named("ioStrategy") final IOService ioService,
                              final UserManagerService userManagerService,
                              final IndexStatusOracle indexOracle,
                              final SpaceConfigStorageRegistry spaceConfigStorageRegistry,
                              final ClusterService clusterService,
                              final ArchetypeService archetypeService); @Override OrganizationalUnitRepositoryInfo getDefaultOrganizationalUnitRepositoryInfo(); @Override OrganizationalUnitRepositoryInfo getOrganizationalUnitRepositoryInfo(final OrganizationalUnit selectedOrganizationalUnit); @Override LibraryInfo getLibraryInfo(final OrganizationalUnit organizationalUnit); @Override WorkspaceProject createProject(final OrganizationalUnit organizationalUnit,
                                          final String remoteRepositoryUrl,
                                          final String repositoryAlias); @Override WorkspaceProject createProject(final String projectName,
                                          final OrganizationalUnit selectedOrganizationalUnit,
                                          final String projectDescription,
                                          final DeploymentMode deploymentMode); @Override WorkspaceProject createProject(final OrganizationalUnit activeOrganizationalUnit,
                                          final POM pom,
                                          final DeploymentMode mode); @Override WorkspaceProject createProject(final OrganizationalUnit activeOrganizationalUnit,
                                          final POM pom,
                                          final DeploymentMode mode,
                                          final String templateId); @Override WorkspaceProject createProject(final OrganizationalUnit activeOrganizationalUnit,
                                          final POM pom,
                                          final DeploymentMode mode,
                                          final String templateId,
                                          final String remoteRepositoryUrl); @Override Boolean thereIsAProjectInTheWorkbench(); @Override AssetQueryResult getProjectAssets(final ProjectAssetsQuery query); @Override Boolean hasProjects(final OrganizationalUnit organizationalUnit); @Override Boolean hasAssets(final WorkspaceProject project); @Override Set<ImportProject> getExampleProjects(OrganizationalUnit organizationalUnit); @Override List<OrganizationalUnit> getOrganizationalUnits(); @Override GAV createGAV(final String projectName,
                         final OrganizationalUnit selectedOrganizationalUnit); @Override synchronized List<String> getAllUsers(); @Override void addBranch(final String newBranchName,
                          final String baseBranchName,
                          final WorkspaceProject project); @Override void removeBranch(final WorkspaceProject project,
                             final Branch branch); @Override BranchPermissions loadBranchPermissions(final String spaceName,
                                                   final String projectIdentifier,
                                                   final String branchName); @Override void saveBranchPermissions(final String spaceName,
                                      final String projectIdentifier,
                                      final String branchName,
                                      final BranchPermissions branchPermissions); @Override Boolean isClustered(); @Override int getNumberOfAssets(final ProjectAssetsQuery query); @Override int getNumberOfAssets(final WorkspaceProject module); @Override OrganizationalUnit getDefaultOrganizationalUnit(); }
LibraryServiceImpl implements LibraryService { @Override public Set<ImportProject> getExampleProjects(OrganizationalUnit organizationalUnit) { final String importProjectsUrl = getCustomImportProjectsUrl(); final ExampleRepository repository = importProjectsUrl == null || importProjectsUrl.isEmpty() ? examplesService.getPlaygroundRepository() : new ExampleRepository(importProjectsUrl); final Set<ImportProject> projects = examplesService.getProjects(organizationalUnit, repository); return projects; } LibraryServiceImpl(); @Inject  LibraryServiceImpl(final OrganizationalUnitService ouService,
                              final RefactoringQueryService refactoringQueryService,
                              final LibraryPreferences preferences,
                              final AuthorizationManager authorizationManager,
                              final SessionInfo sessionInfo,
                              final ExplorerServiceHelper explorerServiceHelper,
                              final WorkspaceProjectService projectService,
                              final KieModuleService moduleService,
                              final ExamplesService examplesService,
                              @Named("ioStrategy") final IOService ioService,
                              final UserManagerService userManagerService,
                              final IndexStatusOracle indexOracle,
                              final SpaceConfigStorageRegistry spaceConfigStorageRegistry,
                              final ClusterService clusterService,
                              final ArchetypeService archetypeService); @Override OrganizationalUnitRepositoryInfo getDefaultOrganizationalUnitRepositoryInfo(); @Override OrganizationalUnitRepositoryInfo getOrganizationalUnitRepositoryInfo(final OrganizationalUnit selectedOrganizationalUnit); @Override LibraryInfo getLibraryInfo(final OrganizationalUnit organizationalUnit); @Override WorkspaceProject createProject(final OrganizationalUnit organizationalUnit,
                                          final String remoteRepositoryUrl,
                                          final String repositoryAlias); @Override WorkspaceProject createProject(final String projectName,
                                          final OrganizationalUnit selectedOrganizationalUnit,
                                          final String projectDescription,
                                          final DeploymentMode deploymentMode); @Override WorkspaceProject createProject(final OrganizationalUnit activeOrganizationalUnit,
                                          final POM pom,
                                          final DeploymentMode mode); @Override WorkspaceProject createProject(final OrganizationalUnit activeOrganizationalUnit,
                                          final POM pom,
                                          final DeploymentMode mode,
                                          final String templateId); @Override WorkspaceProject createProject(final OrganizationalUnit activeOrganizationalUnit,
                                          final POM pom,
                                          final DeploymentMode mode,
                                          final String templateId,
                                          final String remoteRepositoryUrl); @Override Boolean thereIsAProjectInTheWorkbench(); @Override AssetQueryResult getProjectAssets(final ProjectAssetsQuery query); @Override Boolean hasProjects(final OrganizationalUnit organizationalUnit); @Override Boolean hasAssets(final WorkspaceProject project); @Override Set<ImportProject> getExampleProjects(OrganizationalUnit organizationalUnit); @Override List<OrganizationalUnit> getOrganizationalUnits(); @Override GAV createGAV(final String projectName,
                         final OrganizationalUnit selectedOrganizationalUnit); @Override synchronized List<String> getAllUsers(); @Override void addBranch(final String newBranchName,
                          final String baseBranchName,
                          final WorkspaceProject project); @Override void removeBranch(final WorkspaceProject project,
                             final Branch branch); @Override BranchPermissions loadBranchPermissions(final String spaceName,
                                                   final String projectIdentifier,
                                                   final String branchName); @Override void saveBranchPermissions(final String spaceName,
                                      final String projectIdentifier,
                                      final String branchName,
                                      final BranchPermissions branchPermissions); @Override Boolean isClustered(); @Override int getNumberOfAssets(final ProjectAssetsQuery query); @Override int getNumberOfAssets(final WorkspaceProject module); @Override OrganizationalUnit getDefaultOrganizationalUnit();  }