SolutionImportHandler implements IPlatformImportHandler { private RepositoryFile getFile( IPlatformImportBundle importBundle, IRepositoryFileBundle fileBundle ) { String repositoryFilePath = repositoryPathConcat( importBundle.getPath(), fileBundle.getPath(), fileBundle.getFile().getName() ); return repository.getFile( repositoryFilePath ); } 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 testGetFile() { RepositoryFileImportBundle importBundle = new RepositoryFileImportBundle(); importBundle.setPath( "/BASE_PATH/" ); RepositoryFile repoFile = new RepositoryFile.Builder( "FILE_NAME" ).build(); IRepositoryFileBundle fileBundle = new RepositoryFileBundle( repoFile, null, "parentDir", null, "UTF-8", null ); fileBundle.setPath( "SUB_PATH/" ); RepositoryFile expectedFile = new RepositoryFile.Builder( "EXPECTED_FILE" ).build(); Mockito.when( repository.getFile( "/BASE_PATH/SUB_PATH/FILE_NAME" ) ).thenReturn( expectedFile ); RepositoryFile actualFile = Deencapsulation.invoke( importHandler, "getFile", importBundle, fileBundle ); Assert.assertEquals( expectedFile, actualFile ); }