Skip to content

Commit 3b9dfb6

Browse files
Fix jmx2dsl conversion when empty header is specified
1 parent e335de0 commit 3b9dfb6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

jmeter-java-dsl/src/main/java/us/abstracta/jmeter/javadsl/codegeneration/params/StringParam.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public StringParam(String value) {
2020

2121
@Override
2222
public String buildCode(String indent) {
23-
return buildStringLiteral(value, indent);
23+
return buildStringLiteral(value == null ? "" : value, indent);
2424
}
2525

2626
}

jmeter-java-dsl/src/test/java/us/abstracta/jmeter/javadsl/http/HttpHeadersTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public DslTestPlan testPlanWithHeaders() {
1919
httpHeaders()
2020
.header("Accept", "application/json")
2121
.header("X-My-Header", "my-value")
22+
.header("X-Other-Header", "")
2223
.contentType(ContentType.APPLICATION_JSON),
2324
httpSampler("http://localhost")
2425
)

0 commit comments

Comments
 (0)