@Test public void saveExecutionStreamToFile_should_save_execution_stream_to_file() throws IOException { final Stream stream = new Stream() .withData(new byte[] { 'a', 'b', 'c' }); Execution execution = new Execution() .withResponse(new Response() .withStream(stream)); try { cut.saveExecutionStreamToFile(execution); assertThat(stream.getData()).isNull(); assertThat(stream.getTempFile()).isNotNull(); assertThat(FileUtils.readFileToString(stream.getTempFile(), StandardCharsets.UTF_8)).isEqualTo("abc"); } finally { FileUtils.deleteQuietly(stream.getTempFile()); } }
void saveExecutionStreamToFile(Execution execution) throws IOException { if (execution.getResponse() == null || execution.getResponse().getStream() == null || execution.getResponse().getStream().getData() == null) { return; } final Stream stream = execution.getResponse().getStream(); File file = File.createTempFile("ara_execution_response_stream_", ".bin"); file.deleteOnExit(); FileUtils.writeByteArrayToFile(file, stream.getData()); stream.setTempFile(file); stream.setData(null); }
PostmanService { void saveExecutionStreamToFile(Execution execution) throws IOException { if (execution.getResponse() == null || execution.getResponse().getStream() == null || execution.getResponse().getStream().getData() == null) { return; } final Stream stream = execution.getResponse().getStream(); File file = File.createTempFile("ara_execution_response_stream_", ".bin"); file.deleteOnExit(); FileUtils.writeByteArrayToFile(file, stream.getData()); stream.setTempFile(file); stream.setData(null); } }
PostmanService { void saveExecutionStreamToFile(Execution execution) throws IOException { if (execution.getResponse() == null || execution.getResponse().getStream() == null || execution.getResponse().getStream().getData() == null) { return; } final Stream stream = execution.getResponse().getStream(); File file = File.createTempFile("ara_execution_response_stream_", ".bin"); file.deleteOnExit(); FileUtils.writeByteArrayToFile(file, stream.getData()); stream.setTempFile(file); stream.setData(null); }  }
PostmanService { void saveExecutionStreamToFile(Execution execution) throws IOException { if (execution.getResponse() == null || execution.getResponse().getStream() == null || execution.getResponse().getStream().getData() == null) { return; } final Stream stream = execution.getResponse().getStream(); File file = File.createTempFile("ara_execution_response_stream_", ".bin"); file.deleteOnExit(); FileUtils.writeByteArrayToFile(file, stream.getData()); stream.setTempFile(file); stream.setData(null); }  void parse(JsonParser parser, NewmanParsingResult result); List<ExecutedScenario> postProcess(Run run, NewmanParsingResult result, String newmanReportPath, AtomicInteger requestPosition); void deleteTempFiles(NewmanParsingResult newmanParsingResult); }
PostmanService { void saveExecutionStreamToFile(Execution execution) throws IOException { if (execution.getResponse() == null || execution.getResponse().getStream() == null || execution.getResponse().getStream().getData() == null) { return; } final Stream stream = execution.getResponse().getStream(); File file = File.createTempFile("ara_execution_response_stream_", ".bin"); file.deleteOnExit(); FileUtils.writeByteArrayToFile(file, stream.getData()); stream.setTempFile(file); stream.setData(null); }  void parse(JsonParser parser, NewmanParsingResult result); List<ExecutedScenario> postProcess(Run run, NewmanParsingResult result, String newmanReportPath, AtomicInteger requestPosition); void deleteTempFiles(NewmanParsingResult newmanParsingResult); static final String FOLDER_DELIMITER; }