SolutionImportHandler implements IPlatformImportHandler { private boolean isSchedulable( RepositoryFile file, ManifestFile manifestFile ) { Boolean result = manifestFile.isFileSchedulable(); if ( result != null ) { return result; } if ( file != null ) { return file.isSchedulable(); } return RepositoryFile.SCHEDULABLE_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 testIsSchedulable() { ManifestFile manifestFile = Mockito.mock( ManifestFile.class ); RepositoryFile repoFile = new RepositoryFile.Builder( "FILE_NAME" ).schedulable( true ).build(); Mockito.when( manifestFile.isFileSchedulable() ).thenReturn( true ); Assert.assertTrue( runIsSchedulable( repoFile, manifestFile ) ); Mockito.when( manifestFile.isFileSchedulable() ).thenReturn( false ); Assert.assertFalse( runIsSchedulable( repoFile, manifestFile ) ); Mockito.when( manifestFile.isFileSchedulable() ).thenReturn( null ); Assert.assertTrue( runIsSchedulable( repoFile, manifestFile ) ); Assert.assertEquals( RepositoryFile.SCHEDULABLE_BY_DEFAULT, runIsSchedulable( null, manifestFile ) ); }