@Test @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class) public void saveBamExceptionHandlingTest() throws IOException { BamFile bamFile = new BamFile(); bamFile.setId(WRONG_FILE_ID); Track<Read> fullTrackQ = getBaseReadTrack(bamFile); BamQueryOption option = new BamQueryOption(); ResponseEmitterMock emitterMock = new ResponseEmitterMock(); bamManager.sendBamTrackToEmitter(fullTrackQ, option, emitterMock); Assert.assertEquals(emitterMock.getResultStatus(), ResultReference.ResultStatus.ERROR.toString()); Assert.assertTrue(!emitterMock.getMessage().isEmpty()); }
public void sendBamTrackToEmitter(final Track<Read> track, BamQueryOption option, ResponseBodyEmitter emitter) throws IOException { final Chromosome chromosome = trackHelper.validateTrack(track); BamQueryOption currentOptions = option == null ? new BamQueryOption() : option; BamUtil.validateOptions(currentOptions, chromosome); fillEmitterByBamTrack(track, currentOptions, emitter); }
BamManager { public void sendBamTrackToEmitter(final Track<Read> track, BamQueryOption option, ResponseBodyEmitter emitter) throws IOException { final Chromosome chromosome = trackHelper.validateTrack(track); BamQueryOption currentOptions = option == null ? new BamQueryOption() : option; BamUtil.validateOptions(currentOptions, chromosome); fillEmitterByBamTrack(track, currentOptions, emitter); } }
BamManager { public void sendBamTrackToEmitter(final Track<Read> track, BamQueryOption option, ResponseBodyEmitter emitter) throws IOException { final Chromosome chromosome = trackHelper.validateTrack(track); BamQueryOption currentOptions = option == null ? new BamQueryOption() : option; BamUtil.validateOptions(currentOptions, chromosome); fillEmitterByBamTrack(track, currentOptions, emitter); }  }
BamManager { public void sendBamTrackToEmitter(final Track<Read> track, BamQueryOption option, ResponseBodyEmitter emitter) throws IOException { final Chromosome chromosome = trackHelper.validateTrack(track); BamQueryOption currentOptions = option == null ? new BamQueryOption() : option; BamUtil.validateOptions(currentOptions, chromosome); fillEmitterByBamTrack(track, currentOptions, emitter); }  BamFile registerBam(final IndexedFileRegistrationRequest request); BamFile unregisterBamFile(final long bamFileId); void sendBamTrackToEmitter(final Track<Read> track, BamQueryOption option, ResponseBodyEmitter emitter); void sendBamTrackToEmitterFromUrl(final Track<Read> track, BamQueryOption option, String bamUrl,
                                                       String indexUrl, ResponseBodyEmitter emitter); Track<Sequence> calculateConsensusSequence(final Track<Sequence> track); Read loadRead(final ReadQuery query, String fileUrl, String indexUrl); }
BamManager { public void sendBamTrackToEmitter(final Track<Read> track, BamQueryOption option, ResponseBodyEmitter emitter) throws IOException { final Chromosome chromosome = trackHelper.validateTrack(track); BamQueryOption currentOptions = option == null ? new BamQueryOption() : option; BamUtil.validateOptions(currentOptions, chromosome); fillEmitterByBamTrack(track, currentOptions, emitter); }  BamFile registerBam(final IndexedFileRegistrationRequest request); BamFile unregisterBamFile(final long bamFileId); void sendBamTrackToEmitter(final Track<Read> track, BamQueryOption option, ResponseBodyEmitter emitter); void sendBamTrackToEmitterFromUrl(final Track<Read> track, BamQueryOption option, String bamUrl,
                                                       String indexUrl, ResponseBodyEmitter emitter); Track<Sequence> calculateConsensusSequence(final Track<Sequence> track); Read loadRead(final ReadQuery query, String fileUrl, String indexUrl);  }