I have requirement where i need to check the Amount if the amount is greater than or equal to 0 then i need to match CreditDebitIndicator as CREDIT . If the Amount is less than zero then i need to match CreditDebitIndicator as debit .I have tried in all the ways i did't get the required information from document. can please some help me with this scenario.
I have tried in this way
def store = response.Data.Transactions[0].CreditDebitIndicator
And assert response.Data.Transactions[0].Amount.Amount <= [0]
And assert (response.Data.Transactions[0].Amount.Amount <= [0] ? { store : 'CREDIT'})
my json is :
{"Data": {
"Transactions": [
{`enter code here`
"AccountId": "13315",
"TransactionId": "12345678",
"TransactionReference": "FT14112N7BH5",
"Amount": {
"Amount": "-55020.00",
"Currency": "USD"
},
"CreditDebitIndicator": "CREDIT",
"Status": "Enabled",
"BookingDateTime": "2014-04-22T00:00:00+0000",
"ValueDateTime": "2014-04-22T00:00:00+0000",
"TransactionInformation": "AccountTransfer",
"BankTransactionCode": {
"Code": "NULM",
"SubCode": "NULMI"
},