vendredi 20 mai 2016

Jmeter http post sampler syntax

I'm triyng to test a rest api using jmeter script. When I launch the test, I get the following exception:

{"timestamp" : 1463775753585,
"status" : 400,
"error" : "Bad Request",
"exception" : "org.springframework.http.converter.HttpMessageNotReadableException",
"message" : "Could not read JSON: (was java.lang.NullPointerException) (through reference chain: com.tutos.example.models.Product[\"category\"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException) (through reference chain: com.tutos.example.models.Product[\"category\"])",
"path" : "/product"
}

Here is my data of post:

{"code":${productCode}, "intitule":"${productName}", "cost":"${cost}", "category":{"id":"${categoryId}"}} 

But when I remove the property category, everything is OK.

What am I missing please ?

Aucun commentaire:

Enregistrer un commentaire