I'm searching for a solution how to assert Jmeter JSON response against Database data and print discrepancies in Assertion result message
Jmeter JSON response example
{"data": [
{
"code": 99,
"name": "A"
},
{
"code": 2,
"name": "B"
},
{
"code": 7,
"name": "C"
},
{
"code": 4,
"name": "D"
},
{
"code": 6,
"name": "E"
},
{
"code": 3,
"name": "C"
}
]}
Database data as fetched through JDBC Sampler as JSON
[
{
"name": "A",
"code": 1
},
{
"name": "B",
"code": 2
},
{
"name": "F",
"code": 7
},
{
"name": "D",
"code": 4
},
{
"name": "E",
"code": 6
},
{
"name": "C",
"code": 3
}
]
Assertion message example
Discrepancies
API DB
{"code": 99,"name": "a"} <-> {"name": "A","code": 1}