Skip to content

Commit 98df7c2

Browse files
committed
fixed compilation issue in generated tests when dealing with multipart
1 parent 8921b86 commit 98df7c2

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

core/src/main/kotlin/org/evomaster/core/output/service/HttpWsTestCaseWriter.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,9 @@ abstract class HttpWsTestCaseWriter : ApiTestCaseWriter() {
633633
val send = sendBodyCommand()
634634

635635
val body = bodyParam.getValueAsPrintableString(mode = GeneUtils.EscapeMode.TEXT, targetFormat = format)
636+
637+
val text = GeneUtils.applyEscapes(body, mode = GeneUtils.EscapeMode.TEXT, format = format)
638+
636639
// handle body only if it is not black
637640
if (body.isNotBlank()) {
638641
if (body != "\"\"") {
@@ -641,11 +644,11 @@ abstract class HttpWsTestCaseWriter : ApiTestCaseWriter() {
641644
if (body.trim().isBlank()) {
642645
lines.add("body = \"\"")
643646
} else {
644-
lines.add("body = $body")
647+
lines.add("body = \"$text\"")
645648
}
646649
}
647650

648-
else -> lines.add(".$send($body)")
651+
else -> lines.add(".$send(\"$text\")")
649652
}
650653
} else {
651654
when {

0 commit comments

Comments
 (0)