Skip to content

Commit 0b2272f

Browse files
committed
minor refactoring
1 parent 1dc2773 commit 0b2272f

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

core/src/main/kotlin/org/evomaster/core/output/auth/TokenWriter.kt

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ object TokenWriter {
5454
if(k.token!!.headerPrefix.isNotEmpty()) {
5555
lines.append("\"${k.token!!.headerPrefix}\"")
5656
}else{
57-
// if (format.isJavaScript() || format.isPython())
58-
lines.append("\"\"")
57+
lines.append("\"\"")
5958
}
6059

6160
if (!format.isPython()) {
@@ -66,7 +65,6 @@ object TokenWriter {
6665
}
6766
}
6867

69-
7068
when{
7169
format.isJavaOrKotlin() -> lines.append("given()")
7270
format.isJavaScript() -> {
@@ -97,10 +95,11 @@ object TokenWriter {
9795
lines.indented { lines.add("error => {console.log(error.response.body); throw Error(\"Auth failed.\")});") }
9896
} else if (format.isPython()) {
9997
lines.add("${tokenName(k)} = ${tokenName(k)} + ${responseName(k)}.json()$path")
100-
}else if (format.isKotlin()) {
101-
lines.add(".then().extract().response().path(\"$path\")!!")
102-
}else {
98+
}else if (format.isJavaOrKotlin()) {
10399
lines.add(".then().extract().response().path(\"$path\")")
100+
if(format.isKotlin()) {
101+
lines.append("!!")
102+
}
104103
}
105104
lines.appendSemicolon()
106105
lines.addEmpty()

0 commit comments

Comments
 (0)