import com.github.javafaker.Faker
class TestSimulation extends Simulation {
val faker = new Faker()
<snip>
faker.name().fullName() // passed into some request body
--
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.
For more options, visit https://groups.google.com/d/optout.
class FakeStreetAddress extends Feeder[String] {
override def next(): Map[String, String] = {
Map("street_address" -> faker.address().zipCode)
}
override def hasNext: Boolean = true
}
missing parameter type for expanded function ((x$1) => x$1.set("full_name", "${faker.name().fullName()}"))To unsubscribe from this group and stop receiving emails from it, send an email to gatling+unsubscribe@googlegroups.com.
class FakeStreetAddress extends Feeder[String] {
override def next(): Map[String, String] = {
Map("street_address" -> faker.address().streetAddress(true))Oops typo, make that:
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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.
val fakeData = Iterator.continually(
Map("full_name" -> faker.name.fullName,
"street_address" -> faker.address.streetAddress(true),
"zip_code" -> faker.address.zipCode,
"state" -> faker.address.stateAbbr,
"city" -> String.format("%s%s", faker.address.cityPrefix, faker.address.citySuffix)
)
)
<snip>
.feed(fakeData)
<snip>
.body( StringBody( """{ "street_address": "${street_address}", }""" ) )Oops typo, make that:
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.