ImportSession { public RepositoryFileExtraMetaData processExtraMetaDataForFile( String filePath ) { RepositoryFileExtraMetaData extraMetaData = null; try { if ( manifest != null ) { ExportManifestEntity entity = manifest.getExportManifestEntity( filePath ); if ( entity != null ) { extraMetaData = entity.getRepositoryFileExtraMetaData(); } } } catch ( Exception e ) { getLogger().trace( e ); } return extraMetaData; }  static ImportSession getSession(); void initialize(); Log getLogger(); @Deprecated Boolean isFileHidden( String filePath ); ManifestFile getManifestFile( String filePath, boolean isFileExist ); RepositoryFileAcl processAclForFile( String filePath ); RepositoryFileExtraMetaData processExtraMetaDataForFile( String filePath ); HashSet<String> getSkippedFiles(); void setSkippedFiles( HashSet<String> skippedFiles ); Boolean getIsNotRunningImport(); ExportManifest getManifest(); void setManifest( ExportManifest manifest ); boolean isApplyAclSettings(); void setApplyAclSettings( boolean applyAclSettings ); boolean isRetainOwnership(); void setRetainOwnership( boolean retainOwnership ); boolean isOverwriteAclSettings(); void setOverwriteAclSettings( boolean overwriteAclSettings ); String getCurrentManifestKey(); void setCurrentManifestKey( String currentManifestKey ); HashSet<String> getFoldersCreatedImplicitly(); void setAclProperties( boolean applyAclSettingsFlag, boolean retainOwnershipFlag,
                                boolean overwriteAclSettingsFlag ); void addImportedRepositoryFile( RepositoryFile repositoryFile ); HashSet<RepositoryFile> getImportedRepositoryFiles(); void addImportedScheduleJobId( String jobId ); List<String> getImportedScheduleJobIds(); static void clearSession(); static IPlatformImporter iPlatformImporter; }
@Test public void testProcessExtraMetaDataForFile() throws ExportManifestFormatException { ExportManifest manifest = mock( ExportManifest.class ); ExportManifestEntity entity = mock( ExportManifestEntity.class ); RepositoryFileExtraMetaData repositoryFileExtraMetaData = mock( RepositoryFileExtraMetaData.class ); when( manifest.getExportManifestEntity( anyString() )).thenReturn( entity ); when( entity.getRepositoryFileExtraMetaData() ).thenReturn( repositoryFileExtraMetaData ); Whitebox.setInternalState( importSession, "manifest", manifest ); Assert.assertEquals( repositoryFileExtraMetaData, importSession.processExtraMetaDataForFile( "filePath" )); }