@Test public void saveExecutionStreamToFile_should_not_crash_if_response_has_null_stream() throws IOException { Execution execution = new Execution() .withResponse(new Response()); cut.saveExecutionStreamToFile(execution); }
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; }