.post("/platform/spi/job/v2/post")
.bodyPart(RawFileBodyPart("jobjson","data/job.json").contentType("application/json").fileName("job.json")).asJson
--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gatling/687f80f1-d39c-4dcd-89f0-666e2b9583c8%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to gat...@googlegroups.com.
.exec(http("postAJob")
.post("/platform/spi/job/v2/post")
.body(StringBody("""{"jobType":"R","jobStartDate":"2020-01-31","jobEndDate":"","attr-job_startDate_flexible":false,"schedule":[{"id":"sunday","times":[{"start":"08:00","end":"17:00"}]},{"id":"tuesday","times":[{"start":"08:00","end":"17:00"}]}],"attr-job_varyingSchedule":true,"jobZip":"02451","kids":[{"ccAgeGroups":"CHLDAGEGP004"}],"attr-job_lightHousekeeping":true,"attr-job_mealPreparation":false,"attr-job_laundry":false,"attr-job_homeworkHelp":false,"attr-job_errandsOrGroceries":false,"attr-job_comfortableWithPets":true,"collegeDegree":false,"attr-job_firstAidOrCPR":false,"attr-job_dropPickupChildren":false,"attr-job_own_transportation":false,"attr-job_nonSmoker":false,"jobRate":{"lowerValue":"12","higherValue":"17"},"serviceId":"CHILDCARE"}"""))
.headers(headers_2)
.check(bodyString.saveAs("jobresponse"))
)
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gatling/017b6f8d-0e48-4a98-abd0-c8bcb172948d%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gatling/017b6f8d-0e48-4a98-abd0-c8bcb172948d%40googlegroups.com.
.post("idm/api/v1/someservice")
.headers(sessionHeaders)
.body(ElFileBody("bodies/someservice_body.json")).asJson
.check(bodyString.saveAs("BODY"))
{
"firstName": "George",
"displayName": "_george_",
"userDescription": "performance engineer"
}
createUsers.scala
import scala.util.Random
import io.gatling.core.Predef._
import io.gatling.core.structure.ChainBuilder
import io.gatling.http.Predef._object createUsers extends Simulation{
val rndNumb = (10000 to 100000000).iterator
def randomString(length: Int):String = {
rnd.alphanumeric.filter(_.isLetter).take(length).mkString
}
val custRandUserFeeder: Iterator[Map[String, String]] = Iterator.continually(Map(
"mediumRandString" -> randomString( 15 ),
"smallRandString" -> randomString(5),
"longRandString" -> randomString( 200 ),
"randomUserPrefix" -> ("George" + rndNumb.next()),
))
def createNewUser: ChainBuilder = {
feed(custRandUserFeeder)
.exec(http("Create New User")
.post("idm/api/v1/createuser")
.headers(sessionHeaders)
.body(ElFileBody("bodies/createUserTemplate.json")).asJson
.check(bodyString.saveAs("BODY"))
.check(jsonPath("$['name']").exists.saveAs("newName"))
)
}}
{
"firstName": "${randomUserPrefix}${smallRandomString}",
"lastName": "Kand${smallRandString}",
"roles": [
{
"name": "CONSUMER"
}
],
"locale": "en_US",
"userId": "gkandale${mediumRandString}",
"email": "gkandale${mediumRandString}@acme.com",
"description": "${longRandString}",
"pwdPolicyname": "strict_auth",
"status": "true"
}
"email": "gkandale${mediumRa...@acme.com",
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gatling/d73ad001-a257-4320-8a93-de2c4037294d%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gatling/1433d167-b662-45d3-9b32-104e7e7731b0%40googlegroups.com.