I'm new to using scala and gatling. I'm defining a scenario which is doing the http post call to create a resource . In one of the key/fields of request body I want to put a unique identifier for the name hence using UUID.randomUUID()however the request is failing when use the below code.
val uuid = UUID.randomUUID().toString
println(uuid)
val scn = scenario("Testing !")
.exec(http("create resource")
.post("/data")
.body(StringBody(
"""{
"add_name": "${uuid}",
}""")).asJSON
.check(status is(200)))
Even though printing uuid does print the id in console but throws error on the post request body as I believe "${uuid}" might be wrong but I'm not sure of.
Any suggestions/help greatly appreciated!