@SuppressWarnings("unchecked") @Test public void testExtractRecordDataOnlySlashesEven() throws Exception { final Downloader downloader = mock(Downloader.class); doAnswer(new Answer<Object>() { @Override public Object answer(final InvocationOnMock invocation) throws Throwable { final Collection<FileRequest> requests = (Collection<FileRequest>) invocation.getArguments()[0]; final FileRequest request = requests.iterator().next(); FileUtils.copyFile(new File("src/test/resources/json/onlySlashesEven.json"), new File(request.getTargetFile())); return null; } }).when(downloader).download(ArgumentMatchers.<Collection<? extends FileRequest>> any()); mockStatic(AuthHelper.class); when(AuthHelper.fromCurrentSubject()).thenReturn(ftpProduct); mockStatic(SftpDownloader.class); when(SftpDownloader.createDownloader(ftpProduct)).thenReturn(downloader); final Record record = RecordFactory.create("REPLY", StructureBuilder.getBuilder().addVC("MULTILINE").build()); new RecordDataExtractor(record, environment).extractRecordData(); assertThat(record.getVC("MULTILINE")).isEqualTo("FirstLine\\\\\\\"=\"S\""); }
public void extractRecordData() throws IOException { final EtmPoint point = PointFactory.getPoint(getClass(), "extractRecordData"); try { final Downloader downloader = SftpDownloader.createDownloader(AuthHelper.fromCurrentSubject()); final Collection<FileRequest> requests = Collections .singleton(FileRequestFactory.create(getRemoteDataLocation(), getLocalDataLocation().toURI())); downloader.download(requests); RecordWriter.putFromJson(retrieveJsonData(), getRecord()); } finally { point.collect(); } }
RecordDataExtractor { public void extractRecordData() throws IOException { final EtmPoint point = PointFactory.getPoint(getClass(), "extractRecordData"); try { final Downloader downloader = SftpDownloader.createDownloader(AuthHelper.fromCurrentSubject()); final Collection<FileRequest> requests = Collections .singleton(FileRequestFactory.create(getRemoteDataLocation(), getLocalDataLocation().toURI())); downloader.download(requests); RecordWriter.putFromJson(retrieveJsonData(), getRecord()); } finally { point.collect(); } } }
RecordDataExtractor { public void extractRecordData() throws IOException { final EtmPoint point = PointFactory.getPoint(getClass(), "extractRecordData"); try { final Downloader downloader = SftpDownloader.createDownloader(AuthHelper.fromCurrentSubject()); final Collection<FileRequest> requests = Collections .singleton(FileRequestFactory.create(getRemoteDataLocation(), getLocalDataLocation().toURI())); downloader.download(requests); RecordWriter.putFromJson(retrieveJsonData(), getRecord()); } finally { point.collect(); } } RecordDataExtractor(final Record record);  RecordDataExtractor(final Record record, final Environment environment); }
RecordDataExtractor { public void extractRecordData() throws IOException { final EtmPoint point = PointFactory.getPoint(getClass(), "extractRecordData"); try { final Downloader downloader = SftpDownloader.createDownloader(AuthHelper.fromCurrentSubject()); final Collection<FileRequest> requests = Collections .singleton(FileRequestFactory.create(getRemoteDataLocation(), getLocalDataLocation().toURI())); downloader.download(requests); RecordWriter.putFromJson(retrieveJsonData(), getRecord()); } finally { point.collect(); } } RecordDataExtractor(final Record record);  RecordDataExtractor(final Record record, final Environment environment); void extractRecordData(); Collection<String> getExtractionCommands(); Record getRecord(); }
RecordDataExtractor { public void extractRecordData() throws IOException { final EtmPoint point = PointFactory.getPoint(getClass(), "extractRecordData"); try { final Downloader downloader = SftpDownloader.createDownloader(AuthHelper.fromCurrentSubject()); final Collection<FileRequest> requests = Collections .singleton(FileRequestFactory.create(getRemoteDataLocation(), getLocalDataLocation().toURI())); downloader.download(requests); RecordWriter.putFromJson(retrieveJsonData(), getRecord()); } finally { point.collect(); } } RecordDataExtractor(final Record record);  RecordDataExtractor(final Record record, final Environment environment); void extractRecordData(); Collection<String> getExtractionCommands(); Record getRecord();  }