doReturn( true ).when( fileService.policy ).isAllowed( RepositoryReadAction.NAME );
doReturn( true ).when( fileService.policy ).isAllowed( RepositoryCreateAction.NAME );
doReturn( true ).when( fileService.policy ).isAllowed( AdministerSecurityAction.NAME );
RepositoryFileDto file = mock( RepositoryFileDto.class );
doReturn( false ).when( file ).isFolder();
doReturn( true ).when( file ).isHidden();
doReturn( file ).when( fileService.defaultUnifiedRepositoryWebService ).getFile( anyString() );
List<RepositoryFileAclAceDto> repositoryFileAclAceDtos = new ArrayList<RepositoryFileAclAceDto>();
RepositoryFileAclDto repositoryFileAclDto = mock( RepositoryFileAclDto.class );
doReturn( "sessionName" ).when( repositoryFileAclDto ).getOwner();
doReturn( true ).when( repositoryFileAclDto ).isEntriesInheriting();
doReturn( repositoryFileAclAceDtos ).when( repositoryFileAclDto ).getAces();
doReturn( repositoryFileAclDto ).when( fileService.defaultUnifiedRepositoryWebService ).getAcl( anyString() );
IPentahoSession pentahoSession = mock( IPentahoSession.class );
doReturn( pentahoSession ).when( fileService ).getSession();
doReturn( "sessionName" ).when( pentahoSession ).getName();
RepositoryFileAclAceDto repositoryFileAclAceDto = mock( RepositoryFileAclAceDto.class );
List<Integer> permissions = new ArrayList<Integer>();
permissions.add( RepositoryFilePermission.ACL_MANAGEMENT.ordinal() );
doReturn( permissions ).when( repositoryFileAclAceDto ).getPermissions();
doReturn( "sessionName" ).when( repositoryFileAclAceDto ).getRecipient();
repositoryFileAclAceDtos.add( repositoryFileAclAceDto );
doReturn( repositoryFileAclAceDtos ).when( fileService.defaultUnifiedRepositoryWebService )
.getEffectiveAces( anyString() );
Map<String, Serializable> metadata = new HashMap<String, Serializable>();
doReturn( metadata ).when( fileService.repository ).getFileMetadata( anyString() );
RepositoryFile sourceFile = mock( RepositoryFile.class );
doReturn( sourceFile ).when( fileService.repository ).getFileById( anyString() );
RepositoryFileDto destFileDto = mock( RepositoryFileDto.class );
doReturn( destFileDto ).when( fileService ).toFileDto( sourceFile, null, false );
RepositoryFile destFile = mock( RepositoryFile.class );
doReturn( destFile ).when( fileService ).toFile( destFileDto );