@Test public void newModuleTest() { when(preferences.getOrganizationalUnitPreferences().getName()).thenReturn("ou2"); when(preferences.getOrganizationalUnitPreferences().getAliasInSingular()).thenReturn("team"); when(preferences.getProjectPreferences().getBranch()).thenReturn("master"); when(preferences.getProjectPreferences().getVersion()).thenReturn("1.0"); final OrganizationalUnit organizationalUnit = mock(OrganizationalUnit.class); when(organizationalUnit.getDefaultGroupId()).thenReturn("ouGroupID"); libraryService.createProject("Module Name!", organizationalUnit, "description", DeploymentMode.VALIDATED); verify(projectService).newProject(eq(organizationalUnit), pomArgumentCaptor.capture(), any()); final POM pom = pomArgumentCaptor.getValue(); assertEquals("Module Name!", pom.getName()); assertEquals("ouGroupID", pom.getGav().getGroupId()); assertEquals("ModuleName", pom.getGav().getArtifactId()); assertEquals("description", pom.getDescription()); }
@Override public WorkspaceProject createProject(final OrganizationalUnit organizationalUnit, final String remoteRepositoryUrl, final String repositoryAlias) { final String projectName = repositoryAlias != null ? repositoryAlias : DEFAULT_PROJECT_NAME; final Optional<Archetype> baseArchetype = archetypeService.getBaseKieArchetype(); final String baseArchetypeAlias = baseArchetype.map(Archetype::getAlias).orElse(null); final GAV gav = createGAV(projectName, organizationalUnit); final POM pom = createPOM(projectName, projectName, gav); return createProject(organizationalUnit, pom, DeploymentMode.VALIDATED, baseArchetypeAlias, remoteRepositoryUrl); }
LibraryServiceImpl implements LibraryService { @Override public WorkspaceProject createProject(final OrganizationalUnit organizationalUnit, final String remoteRepositoryUrl, final String repositoryAlias) { final String projectName = repositoryAlias != null ? repositoryAlias : DEFAULT_PROJECT_NAME; final Optional<Archetype> baseArchetype = archetypeService.getBaseKieArchetype(); final String baseArchetypeAlias = baseArchetype.map(Archetype::getAlias).orElse(null); final GAV gav = createGAV(projectName, organizationalUnit); final POM pom = createPOM(projectName, projectName, gav); return createProject(organizationalUnit, pom, DeploymentMode.VALIDATED, baseArchetypeAlias, remoteRepositoryUrl); } }
LibraryServiceImpl implements LibraryService { @Override public WorkspaceProject createProject(final OrganizationalUnit organizationalUnit, final String remoteRepositoryUrl, final String repositoryAlias) { final String projectName = repositoryAlias != null ? repositoryAlias : DEFAULT_PROJECT_NAME; final Optional<Archetype> baseArchetype = archetypeService.getBaseKieArchetype(); final String baseArchetypeAlias = baseArchetype.map(Archetype::getAlias).orElse(null); final GAV gav = createGAV(projectName, organizationalUnit); final POM pom = createPOM(projectName, projectName, gav); return createProject(organizationalUnit, pom, DeploymentMode.VALIDATED, baseArchetypeAlias, remoteRepositoryUrl); } 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 WorkspaceProject createProject(final OrganizationalUnit organizationalUnit, final String remoteRepositoryUrl, final String repositoryAlias) { final String projectName = repositoryAlias != null ? repositoryAlias : DEFAULT_PROJECT_NAME; final Optional<Archetype> baseArchetype = archetypeService.getBaseKieArchetype(); final String baseArchetypeAlias = baseArchetype.map(Archetype::getAlias).orElse(null); final GAV gav = createGAV(projectName, organizationalUnit); final POM pom = createPOM(projectName, projectName, gav); return createProject(organizationalUnit, pom, DeploymentMode.VALIDATED, baseArchetypeAlias, remoteRepositoryUrl); } 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 WorkspaceProject createProject(final OrganizationalUnit organizationalUnit, final String remoteRepositoryUrl, final String repositoryAlias) { final String projectName = repositoryAlias != null ? repositoryAlias : DEFAULT_PROJECT_NAME; final Optional<Archetype> baseArchetype = archetypeService.getBaseKieArchetype(); final String baseArchetypeAlias = baseArchetype.map(Archetype::getAlias).orElse(null); final GAV gav = createGAV(projectName, organizationalUnit); final POM pom = createPOM(projectName, projectName, gav); return createProject(organizationalUnit, pom, DeploymentMode.VALIDATED, baseArchetypeAlias, remoteRepositoryUrl); } 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();  }