Merge pull request #10167 from slandelle/fix-gatling-json
Fix JSON payloads in the Gatling script
This commit is contained in:
commit
2a57624054
|
@ -16,7 +16,7 @@ class RewardsScenario extends Simulation {
|
||||||
|
|
||||||
exec(http("transactions_add")
|
exec(http("transactions_add")
|
||||||
.post("/transactions/add/")
|
.post("/transactions/add/")
|
||||||
.body(StringBody(_ => s"""{ "customerRewardsId":null,"customerId":"${randCustId()}","transactionDate":null }""")).asJson
|
.body(StringBody(_ => s"""{"customerRewardsId":null,"customerId":${randCustId()},"transactionDate":null}""")).asJson
|
||||||
.check(jsonPath("$.id").saveAs("txnId"))
|
.check(jsonPath("$.id").saveAs("txnId"))
|
||||||
.check(jsonPath("$.transactionDate").saveAs("txtDate"))
|
.check(jsonPath("$.transactionDate").saveAs("txtDate"))
|
||||||
.check(jsonPath("$.customerId").saveAs("custId")))
|
.check(jsonPath("$.customerId").saveAs("custId")))
|
||||||
|
@ -28,13 +28,13 @@ class RewardsScenario extends Simulation {
|
||||||
.doIf("${rwdId.isUndefined()}"){
|
.doIf("${rwdId.isUndefined()}"){
|
||||||
exec(http("rewards_add")
|
exec(http("rewards_add")
|
||||||
.post("/rewards/add")
|
.post("/rewards/add")
|
||||||
.body(StringBody("""{ "customerId": "${custId}" }""")).asJson
|
.body(StringBody("""{"customerId":${custId}}""")).asJson
|
||||||
.check(jsonPath("$.id").saveAs("rwdId")))
|
.check(jsonPath("$.id").saveAs("rwdId")))
|
||||||
}
|
}
|
||||||
|
|
||||||
.exec(http("transactions_update")
|
.exec(http("transactions_update")
|
||||||
.post("/transactions/add/")
|
.post("/transactions/add/")
|
||||||
.body(StringBody("""{ "customerRewardsId":"${rwdId}","customerId":"${custId}","transactionDate":"${txtDate}" }""")).asJson)
|
.body(StringBody("""{"customerRewardsId":${rwdId},"customerId":${custId},"transactionDate":"${txtDate}" }""")).asJson)
|
||||||
|
|
||||||
.exec(http("get_transactions")
|
.exec(http("get_transactions")
|
||||||
.get("/transactions/findAll/${rwdId}"))
|
.get("/transactions/findAll/${rwdId}"))
|
||||||
|
|
Loading…
Reference in New Issue