SolutionImportHandler implements IPlatformImportHandler { private boolean isFileHidden( RepositoryFile file, ManifestFile manifestFile, String sourcePath ) { Boolean result = manifestFile.isFileHidden(); if ( result != null ) { return result; } if ( file != null ) { return file.isHidden(); } if ( solutionHelper.isInHiddenList( sourcePath ) ) { return true; } return RepositoryFile.HIDDEN_BY_DEFAULT; } SolutionImportHandler( List<IMimeType> mimeTypes ); ImportSession getImportSession(); Log getLogger(); @Override void importFile( IPlatformImportBundle bundle ); @Override List<IMimeType> getMimeTypes(); IPlatformImportBundle build( RepositoryFileImportBundle.Builder builder ); Response createSchedulerJob( SchedulerResource scheduler, JobScheduleRequest jobScheduleRequest ); boolean isOverwriteFile(); void setOverwriteFile( boolean overwriteFile );  }
@Test public void testIsFileHidden() { ManifestFile manifestFile = Mockito.mock( ManifestFile.class ); RepositoryFile repoFile = new RepositoryFile.Builder( "FILE_NAME" ).hidden( true ).build(); Mockito.when( manifestFile.isFileHidden() ).thenReturn( true ); Assert.assertTrue( runIsFileHidden( repoFile, manifestFile, "SOURCE_PATH" ) ); Mockito.when( manifestFile.isFileHidden() ).thenReturn( false ); Assert.assertFalse( runIsFileHidden( repoFile, manifestFile, "SOURCE_PATH" ) ); Mockito.when( manifestFile.isFileHidden() ).thenReturn( null ); Assert.assertTrue( runIsFileHidden( repoFile, manifestFile, "SOURCE_PATH" ) ); repoFile = new RepositoryFile.Builder( "FILE_NAME" ).hidden( false ).build(); Assert.assertFalse( runIsFileHidden( repoFile, manifestFile, "SOURCE_PATH" ) ); Mockito.when( solutionHelper.isInHiddenList( "SOURCE_PATH" ) ).thenReturn( true ); Assert.assertTrue( runIsFileHidden( null, manifestFile, "SOURCE_PATH" ) ); Mockito.when( solutionHelper.isInHiddenList( "SOURCE_PATH" ) ).thenReturn( false ); Assert.assertEquals( RepositoryFile.HIDDEN_BY_DEFAULT, runIsFileHidden( null, manifestFile, "SOURCE_PATH" ) ); }