Feed multiple records from SSV File

Hello!
The error occurs [Java.lang.Object;@ when trying to send multiple entries from a file through the feeder

The "#{foo.jsonStringify()}" method is not suitable - by default it substitutes unnecessary characters, in this case

I can’t solve the problem in any way

Part of the code

feederRecord
{"field1": "value1", "field2": "value2"};
{"field1": "value3", "field2": "value4"};
{"field1": "value5", "field2": "value6"}


 val fileFeed = ssv("path/feederRecords.ssv")


.feed(fileFeed, 50)
.body(StringBody("""{"persoproductIdentifiers": [ #{feederRecord} ] }""")

image

First, you’re definitely using an old version. feederRecord shouldn’t be array. Please upgrade.

  • jsonStringify() does what it’s supposed to do: feederRecord is an array of Strings so double quotes in there are escaped.
  • #{feederRecord} will merely call toString

You have 2 possibilities:

  • keep going with a ssv feeder, but then you have to code the concatenation yourself with a function
  • use a jsonFile feeder instead to you get an array of objects instead of an array of Strings so jsonStringify() can encode your values as you expect it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.