Я пытаюсь передать сегодняшнюю дату в Gatling Body, используя session.set, но безуспешно
class gamekeeper extends BaseSimulation {
val timestampFeeder: String = DateTimeFormat.forPattern("yyyy-MM-dd").print(DateTime.now())
exec { session => session.set( "TimestampFeeder", timestampFeeder )}
val createPrivateEvent ={
exec(
http("Create Event As WER")
.post("https://api.cloud/" + {Env} + "/silve-griffin-service/graphql")
.headers(header)
.body(ElFileBody("<filename>"))
.check(status.in(200,201))
.check(bodyString.saveAs("EventAsWER_Response"))
.check(jsonPath(path="$.data.createEvent.id")
.saveAs(key="EventId")
)
)
.exec { session => session.set("NEW_ID", session("EventId").as[String]) }
.exec{session=>println(session);session}
//.pause(40,50)
}
val scenario4 = scenario("Full GameKeeper tests“)
.exec(createPrivateEvent)
setUp(
scenario4.inject(
constantConcurrentUsers(userCount) during(testDuration))
.protocols(httpProtocol)
)
.maxDuration(testDuration)
}
Вот содержимое createeventasWERwithcurrentdatetime.txt
{
"query": "mutation createEvent($input: CreateEventInput!) {\n createEvent(input: $input) {\n ...EventFields\n __typename\n }\n}\n\nfragment EventFields on Event {\n id\n status\n title\n format\n limitedSet\n rulesEnforcementLevel\n pairingType\n entryFee {\n amount\n currency\n __typename\n }\n venue {\n id\n name\n latitude\n longitude\n address\n timeZone\n phoneNumber\n emailAddress\n __typename\n }\n capacity\n description\n scheduledStartTime\n estimatedEndTime\n latitude\n longitude\n address\n timeZone\n phoneNumber\n emailAddress\n shortCode\n __typename\n}",
"variables": {
"input": {
"organizationId": "14540",
"latitude": 47.66499,
"longitude": -122.38043,
"phoneNumber": "206-523-9605",
"emailAddress": "test@gameot.com",
"title": "PerfTestServicesEvent",
"format": "DRAFT",
"pairingType":"SWISS",
"limitedSet": "CORE2020",
"rulesEnforcementLevel": "CASUAL",
"entryFeeAmount": 500,
"entryFeeCurrency": "USD",
"venueId": null,
"capacity": 8,
"description": "test",
"timeZone": "America/Los_Angeles",
"scheduledStartTime": ${TimestampFeeder},
"estimatedEndTime": "2020-02-15T16:00Z"
}
}
}
Кажется, что нет успеха в подстановке значения, почему session.set не может заменить значение TimestampFeeder