Hello! I have inherited the loadtest in my new project and migrated it to the latest Gatling libs (all libs were a few years old), after that all custom feeders are now broken. My knowledge of Scala is limited, can someone please, explain what could be wrong here and how to fix it? Thanks in advance.
val customFeeder: Iterator[Record[String]] = new Feeder[String] {
// always return true as this feeder can be polled infinitively
override def hasNext = true
private def randLong() = timestamp.nextLong()
private val timestamp = new Random
override def next: Map[String, String] = Map("timestamp" -> randLong().toString)
}
Error:
method without a parameter list overrides a method with a single empty one
override def next: Map[String, String] = Map(“timestamp” → randLong().toString)
Generally speaking, I recommend against using our internal aliases (Record and Feeder here).
Moreover, this code can be written in such a more simple way!
val customFeeder =
Iterator.continually(Map("timestamp" -> ThreadLocalRandom.current.nextLong.toString))