ProductManagerBean implements IProductManagerLocal { @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID, UserGroupMapping.ADMIN_ROLE_ID}) @Override public void checkCyclicAssemblyForPartIteration(PartIteration partIteration) throws UserNotFoundException, UserNotActiveException, WorkspaceNotFoundException, NotAllowedException, EntityConstraintException, PartMasterNotFoundException, WorkspaceNotEnabledException { PartMaster partMaster = partIteration.getPartRevision().getPartMaster(); Workspace workspace = partMaster.getWorkspace(); String workspaceId = workspace.getId(); User user = userManager.checkWorkspaceReadAccess(workspaceId); PSFilterVisitorCallbacks callbacks = new PSFilterVisitorCallbacks() { }; psFilterVisitor.visit(workspaceId, new UpdatePartIterationPSFilter(partIteration), partMaster, -1, callbacks); }  @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override List<PartLink[]> findPartUsages(ConfigurationItemKey pKey, ProductStructureFilter filter, String search); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override List<PartMaster> findPartMasters(String pWorkspaceId, String pPartNumber, String pPartName, int pMaxResults); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override ConfigurationItem createConfigurationItem(String pWorkspaceId, String pId, String pDescription, String pDesignItemNumber); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartMaster createPartMaster(String pWorkspaceId, String pNumber, String pName, boolean pStandardPart, String pWorkflowModelId, String pPartRevisionDescription, String templateId, Map<String, String> pACLUserEntries, Map<String, String> pACLUserGroupEntries, Map<String, Collection<String>> userRoleMapping, Map<String, Collection<String>> groupRoleMapping); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartRevision undoCheckOutPart(PartRevisionKey pPartRPK); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartRevision checkOutPart(PartRevisionKey pPartRPK); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartRevision checkInPart(PartRevisionKey pPartRPK); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override BinaryResource getBinaryResource(String pFullName); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override BinaryResource getTemplateBinaryResource(String pFullName); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override BinaryResource saveNativeCADInPartIteration(PartIterationKey pPartIPK, String pName, long pSize); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override BinaryResource saveGeometryInPartIteration(PartIterationKey pPartIPK, String pName, int quality, long pSize, double[] box); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override BinaryResource saveFileInPartIteration(PartIterationKey pPartIPK, String pName, String subType, long pSize); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID, UserGroupMapping.ADMIN_ROLE_ID}) @Override List<ConfigurationItem> getConfigurationItems(String pWorkspaceId); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID, UserGroupMapping.ADMIN_ROLE_ID}) @Override List<ConfigurationItem> searchConfigurationItems(String pWorkspaceId, String q); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID, UserGroupMapping.ADMIN_ROLE_ID}) @Override ConfigurationItem getConfigurationItem(ConfigurationItemKey ciKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartRevision updatePartIteration(PartIterationKey pKey, String pIterationNote, Source source, List<PartUsageLink> pUsageLinks, List<InstanceAttribute> pAttributes, List<InstanceAttributeTemplate> pAttributeTemplates, DocumentRevisionKey[] pLinkKeys, String[] documentLinkComments, String[] lovNames); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override PartRevision getPartRevision(PartRevisionKey pPartRPK); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override List<ModificationNotification> getModificationNotifications(PartIterationKey pPartIPK); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override void removeModificationNotificationsOnIteration(PartIterationKey pPartIPK); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override void removeModificationNotificationsOnRevision(PartRevisionKey pPartRPK); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override void createModificationNotifications(PartIteration modifiedPartIteration); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override void updateModificationNotification(String pWorkspaceId, int pModificationNotificationId, String pAcknowledgementComment); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override List<PartIteration> getUsedByAsComponent(PartRevisionKey partRevisionKey); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override List<PartIteration> getUsedByAsSubstitute(PartRevisionKey partRevisionKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartIteration getPartIteration(PartIterationKey pPartIPK); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void updatePartRevisionACL(String workspaceId, PartRevisionKey revisionKey, Map<String, String> pACLUserEntries, Map<String, String> pACLUserGroupEntries); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void removeACLFromPartRevision(PartRevisionKey revisionKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override List<PartRevision> searchPartRevisions(PartSearchQuery pQuery, int from, int size); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartMaster findPartMasterByCADFileName(String workspaceId, String cadFileName); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override Conversion getConversion(PartIterationKey partIterationKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) @Override Conversion createConversion(PartIterationKey partIterationKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) @Override void removeConversion(PartIterationKey partIterationKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) @Override void endConversion(PartIterationKey partIterationKey, boolean succeed); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) @Override Import createImport(String workspaceId, String fileName); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override List<Import> getImports(String workspaceId, String filename); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override Import getImport(String workspaceId, String id); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW) @Override void endImport(String workspaceId, String id, ImportResult importResult); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void removeImport(String workspaceId, String id); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void updateACLForPartMasterTemplate(String pWorkspaceId, String templateId, Map<String, String> userEntries, Map<String, String> groupEntries); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void removeACLFromPartMasterTemplate(String workspaceId, String partTemplateId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartRevision saveTags(PartRevisionKey revisionKey, String[] pTags); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartRevision removeTag(PartRevisionKey partRevisionKey, String tagName); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartRevision[] findPartRevisionsByTag(String workspaceId, String tagId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartRevision[] getPartRevisionsWithReferenceOrName(String pWorkspaceId, String reference, int maxResults); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartRevision releasePartRevision(PartRevisionKey pRevisionKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartRevision markPartRevisionAsObsolete(PartRevisionKey pRevisionKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartRevision getLastReleasePartRevision(ConfigurationItemKey ciKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override List<ProductBaseline> findBaselinesWherePartRevisionHasIterations(PartRevisionKey partRevisionKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override List<PartUsageLink> getComponents(PartIterationKey pPartIPK); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override boolean partMasterExists(PartMasterKey partMasterKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void deleteConfigurationItem(ConfigurationItemKey configurationItemKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void deleteLayer(String workspaceId, int layerId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override BinaryResource renameFileInPartIteration(String pSubType, String pFullName, String pNewName); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void removeFileInPartIteration(PartIterationKey pPartIPK, String pSubType, String pName); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void setPublicSharedPart(PartRevisionKey pPartRPK, boolean isPublicShared); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartMaster getPartMaster(PartMasterKey pPartMPK); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override List<Layer> getLayers(ConfigurationItemKey pKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override Layer getLayer(int pId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override Layer createLayer(ConfigurationItemKey pKey, String pName, String color); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override Layer updateLayer(ConfigurationItemKey pKey, int pId, String pName, String color); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override Marker createMarker(int pLayerId, String pTitle, String pDescription, double pX, double pY, double pZ); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void deleteMarker(int pLayerId, int pMarkerId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartMasterTemplate[] getPartMasterTemplates(String pWorkspaceId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartMasterTemplate getPartMasterTemplate(PartMasterTemplateKey pKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartMasterTemplate createPartMasterTemplate(String pWorkspaceId, String pId, String pPartType, String pWorkflowModelId, String pMask, List<InstanceAttributeTemplate> pAttributeTemplates, String[] lovNames, List<InstanceAttributeTemplate> pAttributeInstanceTemplates, String[] instanceLovNames, boolean idGenerated, boolean attributesLocked); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartMasterTemplate updatePartMasterTemplate(PartMasterTemplateKey pKey, String pPartType, String pWorkflowModelId, String pMask, List<InstanceAttributeTemplate> pAttributeTemplates, String[] lovNames, List<InstanceAttributeTemplate> pAttributeInstanceTemplates, String[] instanceLovNames, boolean idGenerated, boolean attributesLocked); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void deletePartMasterTemplate(PartMasterTemplateKey pKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override BinaryResource saveFileInTemplate(PartMasterTemplateKey pPartMTemplateKey, String pName, long pSize); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartMasterTemplate removeFileFromTemplate(String pFullName); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override BinaryResource renameFileInTemplate(String pFullName, String pNewName); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override List<PartMaster> getPartMasters(String pWorkspaceId, int start, int pMaxResults); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override List<PartRevision> getPartRevisions(String pWorkspaceId, int start, int pMaxResults); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID, UserGroupMapping.ADMIN_ROLE_ID}) @Override int getPartsInWorkspaceCount(String pWorkspaceId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void deletePartRevision(PartRevisionKey partRevisionKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override int getNumberOfIteration(PartRevisionKey partRevisionKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartRevision createPartRevision(PartRevisionKey revisionKey, String pDescription, String pWorkflowModelId, Map<String, String> pACLUserEntries, Map<String, String> pACLUserGroupEntries, Map<String, Collection<String>> userRoleMapping, Map<String, Collection<String>> groupRoleMapping); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override String generateId(String pWorkspaceId, String pPartMTemplateId); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID, UserGroupMapping.ADMIN_ROLE_ID}) @Override long getDiskUsageForPartsInWorkspace(String pWorkspaceId); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID, UserGroupMapping.ADMIN_ROLE_ID}) @Override long getDiskUsageForPartTemplatesInWorkspace(String pWorkspaceId); @Override PartRevision[] getCheckedOutPartRevisions(String pWorkspaceId); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID, UserGroupMapping.ADMIN_ROLE_ID}) @Override PartRevision[] getAllCheckedOutPartRevisions(String pWorkspaceId); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override SharedPart createSharedPart(PartRevisionKey pPartRevisionKey, String pPassword, Date pExpireDate); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override void deleteSharedPart(SharedEntityKey pSharedEntityKey); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID, UserGroupMapping.ADMIN_ROLE_ID}) @Override boolean canAccess(PartRevisionKey partRKey); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID, UserGroupMapping.ADMIN_ROLE_ID}) @Override boolean canAccess(PartIterationKey partIKey); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID, UserGroupMapping.ADMIN_ROLE_ID}) @Override boolean canUserAccess(User user, PartRevisionKey partRKey); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID, UserGroupMapping.ADMIN_ROLE_ID}) @Override boolean canUserAccess(User user, PartIterationKey partIKey); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID, UserGroupMapping.ADMIN_ROLE_ID}) @Override User checkPartRevisionReadAccess(PartRevisionKey partRevisionKey); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID, UserGroupMapping.ADMIN_ROLE_ID}) @Override boolean canWrite(PartRevisionKey partRKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override Component filterProductStructure(ConfigurationItemKey ciKey, ProductStructureFilter filter, List<PartLink> path, Integer pDepth); @Override @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID, UserGroupMapping.ADMIN_ROLE_ID}) Set<PartRevision> getWritablePartRevisionsFromPath(ConfigurationItemKey configurationItemKey, String path); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override Component filterProductStructureOnLinkType(ConfigurationItemKey ciKey, ProductStructureFilter filter, String configSpecType, String path, String linkType); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override List<PartLink> decodePath(ConfigurationItemKey ciKey, String path); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override List<PartRevision> searchPartRevisions(String workspaceId, Query query); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override Query getQuery(String workspaceId, int queryId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void createQuery(String workspaceId, Query query); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override void deleteQuery(String workspaceId, int queryId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override List<Query> getQueries(String workspaceId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartLink getRootPartUsageLink(ConfigurationItemKey pKey); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID, UserGroupMapping.ADMIN_ROLE_ID}) @Override void checkCyclicAssemblyForPartIteration(PartIteration partIteration); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override ProductStructureFilter getLatestCheckedInPSFilter(String workspaceId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override boolean hasModificationNotification(ConfigurationItemKey ciKey); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override List<InstanceAttribute> getPartIterationsInstanceAttributesInWorkspace(String workspaceId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override List<InstanceAttribute> getPathDataInstanceAttributesInWorkspace(String workspaceId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override List<QueryResultRow> filterProductBreakdownStructure(String workspaceId, Query query); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override List<BinaryResource> getBinaryResourceFromBaseline(int baselineId); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override Map<String, Set<BinaryResource>> getBinariesInTree(Integer baselineId, String workspaceId, ConfigurationItemKey ciKey, ProductStructureFilter psFilter, boolean exportNativeCADFiles, boolean exportDocumentLinks); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override ProductBaseline loadProductBaselineForProductInstanceMaster(ConfigurationItemKey ciKey, String serialNumber); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override Query loadQuery(String workspaceId, int queryId); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override List<PartIteration> getInversePartsLink(DocumentRevisionKey docKey); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override Set<ProductInstanceMaster> getInverseProductInstancesLink(DocumentRevisionKey docKey); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override Set<PathDataMaster> getInversePathDataLink(DocumentRevisionKey docKey); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override PathToPathLink createPathToPathLink(String workspaceId, String configurationItemId, String type, String pathFrom, String pathTo, String description); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override PathToPathLink updatePathToPathLink(String workspaceId, String configurationItemId, int pathToPathLinkId, String description); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override List<String> getPathToPathLinkTypes(String workspaceId, String configurationItemId); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override List<PathToPathLink> getPathToPathLinkFromSourceAndTarget(String workspaceId, String configurationItemId, String sourcePath, String targetPath); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override ProductInstanceMaster findProductByPathMaster(String workspaceId, PathDataMaster pathDataMaster); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override PartMaster getPartMasterFromPath(String workspaceId, String configurationItemId, String partPath); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override void deletePathToPathLink(String workspaceId, String configurationItemId, int pathToPathLinkId); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override List<ResolvedDocumentLink> getDocumentLinksAsDocumentIterations(String workspaceId, String configurationItemId, String configSpec, PartIterationKey partIterationKey); @RolesAllowed({UserGroupMapping.REGULAR_USER_ROLE_ID}) @Override PartIteration findPartIterationByBinaryResource(BinaryResource binaryResource); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartRevision[] getPartRevisionsWithAssignedTasksForGivenUser(String pWorkspaceId, String assignedUserLogin); @RolesAllowed(UserGroupMapping.REGULAR_USER_ROLE_ID) @Override PartRevision[] getPartRevisionsWithOpenedTasksForGivenUser(String pWorkspaceId, String assignedUserLogin);  }
@Test public void checkCyclicDetection() throws EntityConstraintException, PartMasterNotFoundException, UserNotFoundException, WorkspaceNotFoundException, UserNotActiveException, NotAllowedException, WorkspaceNotEnabledException { cyclicAssemblyRule = new CyclicAssemblyRule("user1"); Mockito.when(userManager.checkWorkspaceReadAccess(Matchers.anyString())).thenReturn(cyclicAssemblyRule.getUser()); Mockito.doThrow(EntityConstraintException.class).when(psFilterVisitor).visit(any(String.class), any(ProductStructureFilter.class), any(PartMaster.class), Mockito.eq(-1), any(PSFilterVisitorCallbacks.class)); thrown.expect(EntityConstraintException.class); productManagerBean.checkCyclicAssemblyForPartIteration(cyclicAssemblyRule.getP1().getLastRevision().getLastIteration()); Mockito.verify(indexerManager, Mockito.never()).indexPartIteration(Mockito.any(PartIteration.class)); }