@Test(expected = IllegalStateException.class) public void testSetFileParticipantsFromParentFolderThrowsIllegalStateExceptionWhenFileHasNoFolder() { EcmFile file = new EcmFile(); file.setFolder(null); fileParticipantService.setFileParticipantsFromParentFolder(file); fail("IllegalStateException should have been thrown!"); }
@Transactional(rollbackFor = Exception.class) public EcmFile setFileParticipantsFromParentFolder(EcmFile file) { if (file.getFolder() == null) { throw new IllegalStateException("File doesn't have parent folder!"); } setFileParticipants(file, file.getFolder().getParticipants()); file.setModified(new Date()); return getFileDao().save(file); }
EcmFileParticipantService { @Transactional(rollbackFor = Exception.class) public EcmFile setFileParticipantsFromParentFolder(EcmFile file) { if (file.getFolder() == null) { throw new IllegalStateException("File doesn't have parent folder!"); } setFileParticipants(file, file.getFolder().getParticipants()); file.setModified(new Date()); return getFileDao().save(file); } }
EcmFileParticipantService { @Transactional(rollbackFor = Exception.class) public EcmFile setFileParticipantsFromParentFolder(EcmFile file) { if (file.getFolder() == null) { throw new IllegalStateException("File doesn't have parent folder!"); } setFileParticipants(file, file.getFolder().getParticipants()); file.setModified(new Date()); return getFileDao().save(file); }  }
EcmFileParticipantService { @Transactional(rollbackFor = Exception.class) public EcmFile setFileParticipantsFromParentFolder(EcmFile file) { if (file.getFolder() == null) { throw new IllegalStateException("File doesn't have parent folder!"); } setFileParticipants(file, file.getFolder().getParticipants()); file.setModified(new Date()); return getFileDao().save(file); }  @Transactional(rollbackFor = Exception.class) EcmFile setFileParticipantsFromParentFolder(EcmFile file); @Transactional(rollbackFor = Exception.class) void setFolderParticipantsFromParentFolder(AcmFolder folder); List<AcmParticipant> getFolderParticipantsFromParentAssignedObject(String objectType, Long objectId); List<AcmParticipant> getFolderParticipantsFromAssignedObject(List<AcmParticipant> assignedObjectParticipants); @Transactional(rollbackFor = Exception.class) void inheritParticipantsFromAssignedObject(List<AcmParticipant> assignedObjectParticipants,
            List<AcmParticipant> originalAssignedObjectParticipants, AcmContainer acmContainer, boolean restricted); @Transactional(rollbackFor = Exception.class) List<AcmParticipant> setFileParticipants(Long objectId, List<AcmParticipant> participants); @Transactional(rollbackFor = Exception.class) List<AcmParticipant> setFolderParticipants(Long objectId, List<AcmParticipant> participants); EcmFileDao getFileDao(); void setFileDao(EcmFileDao fileDao); AcmParticipantService getParticipantService(); void setParticipantService(AcmParticipantService participantService); AcmFolderService getFolderService(); void setFolderService(AcmFolderService folderService); EcmFileParticipantServiceHelper getFileParticipantServiceHelper(); void setFileParticipantServiceHelper(EcmFileParticipantServiceHelper fileParticipantServiceHelper); AcmFolderDao getFolderDao(); void setFolderDao(AcmFolderDao folderDao); EcmFileConfig getEcmFileConfig(); void setEcmFileConfig(EcmFileConfig ecmFileConfig); }
EcmFileParticipantService { @Transactional(rollbackFor = Exception.class) public EcmFile setFileParticipantsFromParentFolder(EcmFile file) { if (file.getFolder() == null) { throw new IllegalStateException("File doesn't have parent folder!"); } setFileParticipants(file, file.getFolder().getParticipants()); file.setModified(new Date()); return getFileDao().save(file); }  @Transactional(rollbackFor = Exception.class) EcmFile setFileParticipantsFromParentFolder(EcmFile file); @Transactional(rollbackFor = Exception.class) void setFolderParticipantsFromParentFolder(AcmFolder folder); List<AcmParticipant> getFolderParticipantsFromParentAssignedObject(String objectType, Long objectId); List<AcmParticipant> getFolderParticipantsFromAssignedObject(List<AcmParticipant> assignedObjectParticipants); @Transactional(rollbackFor = Exception.class) void inheritParticipantsFromAssignedObject(List<AcmParticipant> assignedObjectParticipants,
            List<AcmParticipant> originalAssignedObjectParticipants, AcmContainer acmContainer, boolean restricted); @Transactional(rollbackFor = Exception.class) List<AcmParticipant> setFileParticipants(Long objectId, List<AcmParticipant> participants); @Transactional(rollbackFor = Exception.class) List<AcmParticipant> setFolderParticipants(Long objectId, List<AcmParticipant> participants); EcmFileDao getFileDao(); void setFileDao(EcmFileDao fileDao); AcmParticipantService getParticipantService(); void setParticipantService(AcmParticipantService participantService); AcmFolderService getFolderService(); void setFolderService(AcmFolderService folderService); EcmFileParticipantServiceHelper getFileParticipantServiceHelper(); void setFileParticipantServiceHelper(EcmFileParticipantServiceHelper fileParticipantServiceHelper); AcmFolderDao getFolderDao(); void setFolderDao(AcmFolderDao folderDao); EcmFileConfig getEcmFileConfig(); void setEcmFileConfig(EcmFileConfig ecmFileConfig);  }