@Test public void appendRequestBody_should_do_nothing_on_null_body() { StringBuilder html = new StringBuilder(); cut.appendRequestBody(html, null); assertThat(html.toString()).isEmpty(); }
void appendRequestBody(StringBuilder html, Body body) { if (body == null || body.getMode() == null) { return; } switch (body.getMode()) { case "formdata": appendKeyValues(html, body.getFormData()); break; case "urlencoded": appendKeyValues(html, body.getUrlEncoded()); break; case "raw": html.append("<pre>").append(escapeHtml(body.getRaw())).append("</pre>\n"); break; case "file": log.error("File upload was used in a collection, while its collection export is absent in Postman."); html.append(ERROR_PARAGRAPH + "Postman does not export the files to upload, so it has not been sent..." + PARAGRAPH_AND_LINE_END); break; default: log.error("Used new/unknown request body mode {}", body.getMode()); html.append(ERROR_PARAGRAPH + "Used new (unknown to ARA) request body mode ") .append(body.getMode()) .append(PARAGRAPH_AND_LINE_END); break; } }
PostmanService { void appendRequestBody(StringBuilder html, Body body) { if (body == null || body.getMode() == null) { return; } switch (body.getMode()) { case "formdata": appendKeyValues(html, body.getFormData()); break; case "urlencoded": appendKeyValues(html, body.getUrlEncoded()); break; case "raw": html.append("<pre>").append(escapeHtml(body.getRaw())).append("</pre>\n"); break; case "file": log.error("File upload was used in a collection, while its collection export is absent in Postman."); html.append(ERROR_PARAGRAPH + "Postman does not export the files to upload, so it has not been sent..." + PARAGRAPH_AND_LINE_END); break; default: log.error("Used new/unknown request body mode {}", body.getMode()); html.append(ERROR_PARAGRAPH + "Used new (unknown to ARA) request body mode ") .append(body.getMode()) .append(PARAGRAPH_AND_LINE_END); break; } } }
PostmanService { void appendRequestBody(StringBuilder html, Body body) { if (body == null || body.getMode() == null) { return; } switch (body.getMode()) { case "formdata": appendKeyValues(html, body.getFormData()); break; case "urlencoded": appendKeyValues(html, body.getUrlEncoded()); break; case "raw": html.append("<pre>").append(escapeHtml(body.getRaw())).append("</pre>\n"); break; case "file": log.error("File upload was used in a collection, while its collection export is absent in Postman."); html.append(ERROR_PARAGRAPH + "Postman does not export the files to upload, so it has not been sent..." + PARAGRAPH_AND_LINE_END); break; default: log.error("Used new/unknown request body mode {}", body.getMode()); html.append(ERROR_PARAGRAPH + "Used new (unknown to ARA) request body mode ") .append(body.getMode()) .append(PARAGRAPH_AND_LINE_END); break; } }  }
PostmanService { void appendRequestBody(StringBuilder html, Body body) { if (body == null || body.getMode() == null) { return; } switch (body.getMode()) { case "formdata": appendKeyValues(html, body.getFormData()); break; case "urlencoded": appendKeyValues(html, body.getUrlEncoded()); break; case "raw": html.append("<pre>").append(escapeHtml(body.getRaw())).append("</pre>\n"); break; case "file": log.error("File upload was used in a collection, while its collection export is absent in Postman."); html.append(ERROR_PARAGRAPH + "Postman does not export the files to upload, so it has not been sent..." + PARAGRAPH_AND_LINE_END); break; default: log.error("Used new/unknown request body mode {}", body.getMode()); html.append(ERROR_PARAGRAPH + "Used new (unknown to ARA) request body mode ") .append(body.getMode()) .append(PARAGRAPH_AND_LINE_END); break; } }  void parse(JsonParser parser, NewmanParsingResult result); List<ExecutedScenario> postProcess(Run run, NewmanParsingResult result, String newmanReportPath, AtomicInteger requestPosition); void deleteTempFiles(NewmanParsingResult newmanParsingResult); }
PostmanService { void appendRequestBody(StringBuilder html, Body body) { if (body == null || body.getMode() == null) { return; } switch (body.getMode()) { case "formdata": appendKeyValues(html, body.getFormData()); break; case "urlencoded": appendKeyValues(html, body.getUrlEncoded()); break; case "raw": html.append("<pre>").append(escapeHtml(body.getRaw())).append("</pre>\n"); break; case "file": log.error("File upload was used in a collection, while its collection export is absent in Postman."); html.append(ERROR_PARAGRAPH + "Postman does not export the files to upload, so it has not been sent..." + PARAGRAPH_AND_LINE_END); break; default: log.error("Used new/unknown request body mode {}", body.getMode()); html.append(ERROR_PARAGRAPH + "Used new (unknown to ARA) request body mode ") .append(body.getMode()) .append(PARAGRAPH_AND_LINE_END); break; } }  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; }