@Test public void unexistentProjectDosNotHaveAssetsTest() { final Path path = mockPath("file: final Package package1 = mock(Package.class); final WorkspaceProject project1 = mock(WorkspaceProject.class); when(project1.getRootPath()).thenReturn(path); final Module module = mock(Module.class); when(project1.getMainModule()).thenReturn(module); doReturn(false).when(ioService).exists(any()); doReturn(package1).when(moduleService).resolveDefaultPackage(module); doReturn(true).when(explorerServiceHelper).hasAssets(package1); assertFalse(libraryService.hasAssets(project1)); }
@Override public Boolean hasAssets(final WorkspaceProject project) { checkNotNull("LibraryServiceImpl.project", project); final boolean projectStillExists = ioService.exists(Paths.convert(project.getRootPath())); if (!projectStillExists) { return false; } final Package defaultPackage = moduleService.resolveDefaultPackage(project.getMainModule()); return explorerServiceHelper.hasAssets(defaultPackage); }
LibraryServiceImpl implements LibraryService { @Override public Boolean hasAssets(final WorkspaceProject project) { checkNotNull("LibraryServiceImpl.project", project); final boolean projectStillExists = ioService.exists(Paths.convert(project.getRootPath())); if (!projectStillExists) { return false; } final Package defaultPackage = moduleService.resolveDefaultPackage(project.getMainModule()); return explorerServiceHelper.hasAssets(defaultPackage); } }
LibraryServiceImpl implements LibraryService { @Override public Boolean hasAssets(final WorkspaceProject project) { checkNotNull("LibraryServiceImpl.project", project); final boolean projectStillExists = ioService.exists(Paths.convert(project.getRootPath())); if (!projectStillExists) { return false; } final Package defaultPackage = moduleService.resolveDefaultPackage(project.getMainModule()); return explorerServiceHelper.hasAssets(defaultPackage); } 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 Boolean hasAssets(final WorkspaceProject project) { checkNotNull("LibraryServiceImpl.project", project); final boolean projectStillExists = ioService.exists(Paths.convert(project.getRootPath())); if (!projectStillExists) { return false; } final Package defaultPackage = moduleService.resolveDefaultPackage(project.getMainModule()); return explorerServiceHelper.hasAssets(defaultPackage); } 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 Boolean hasAssets(final WorkspaceProject project) { checkNotNull("LibraryServiceImpl.project", project); final boolean projectStillExists = ioService.exists(Paths.convert(project.getRootPath())); if (!projectStillExists) { return false; } final Package defaultPackage = moduleService.resolveDefaultPackage(project.getMainModule()); return explorerServiceHelper.hasAssets(defaultPackage); } 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();  }