gopp gopp - 6 months ago 23
JSON Question

POST method is not inserting data into the two database tables

I'm using RestAssured to test an API.

I have the following, wow can I test the post method?

"name": "Test",
"email": "",
"occupation": [{
"id": 1,
"feature": {
"id": 2
"company": 7777,

"Occupation" is another table, how can I on both tables?
I have tried this:

.body("{\"name\": \"test\", \"email\": \"\", \"occupation\": {\"id\": 15, \"feature\": {\"id\": 15}", \"company\": \"7777\"}}")

But the error

"Can not deserialize instance of java.util.ArrayList out of

is shown.

dso dso
Answer Source

{\"id\": 15, \"feature\": {\"id\": 15}", \"company\": \"7777\"}}"

Try using JSON array here, too!

f.e.: [{\"id\": 1, \"feature\": {\"id\": 2}", \"company\": \"7777\"}]"

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download