madden1942
10 years agoOccasional Contributor
Variable assertions?
I have a rest service that returns inventory status for products.
The inventory status is determined by the code in the software and is not stored in the database and works of the following rules
if availableQuantity >=1 show "Available"
Or
if availableQuantity =0 show "Unavailable".
for reference this is a sample of the JSON response;
{
"InventoryAvailability": [
{
"availableQuantity": "0.0",
"inventoryStatus": "Unavailable",
"onlineStoreId": "10151",
"onlineStoreName": "Store",
"productId": "259008",
"unitOfMeasure": "C62"
},
{
"availableQuantity": "914.0",
"inventoryStatus": "Available",
"onlineStoreId": "10151",
"onlineStoreName": "Store",
"productId": "259010",
"unitOfMeasure": "C62"
}
The issue that i am having is being able to assert for the "inventoryStatus" value based on the "availableQuantity" value using the above rule.
Any help would be fantastic
Many Thanks
Tim (SoapUI Pro 5.1.2)
The inventory status is determined by the code in the software and is not stored in the database and works of the following rules
if availableQuantity >=1 show "Available"
Or
if availableQuantity =0 show "Unavailable".
for reference this is a sample of the JSON response;
{
"InventoryAvailability": [
{
"availableQuantity": "0.0",
"inventoryStatus": "Unavailable",
"onlineStoreId": "10151",
"onlineStoreName": "Store",
"productId": "259008",
"unitOfMeasure": "C62"
},
{
"availableQuantity": "914.0",
"inventoryStatus": "Available",
"onlineStoreId": "10151",
"onlineStoreName": "Store",
"productId": "259010",
"unitOfMeasure": "C62"
}
The issue that i am having is being able to assert for the "inventoryStatus" value based on the "availableQuantity" value using the above rule.
Any help would be fantastic
Many Thanks
Tim (SoapUI Pro 5.1.2)