I'm trying to compare response with predefined JSON (expected) generated by JS function.
JS:
function(fleetId) {
var result = {};
result.name = "TestConnection";
result.fleetId = fleetId;
result.connectionConfigDefault = { "configParameters": [{ "keyName": "N/A", "value": "testValue" }], "id": 4 }
return result;
}
Test:
...
Then match connection.response ==
"""
{
connectionConfigDefault: '#(connectionJson.connectionConfigDefault)',
fleetId: '#(connectionJson.fleetId)',
id: '#number',
name: '#(connectionJson.name)'
}
"""
JS return:
"connectionConfigDefault": {
"configParameters": { "0": { "keyName": "N/A", "value": "testValue" } }
}
instead of expected:
"connectionConfigDefault": {
"configParameters": [{ "keyName": "N/A", "value": "testValue" }]
}
P.S. I read similar question, but the answer did not help me to solve the problem.