Create a file at test/input.json
with the inputs for testing:
{
"inputs": [
{
"topic": "financial_txns",
"value": {
"id": "1",
"transaction": {
"num_shares": 50000,
"amount": 50044568.89,
"txn_ts": "2020-11-18 02:31:43",
"customer": {
"first_name": "Jill",
"last_name": "Smith",
"id": 1234567,
"email": "jsmith@gmail.com"
},
"company": {
"name": "ACME Corp",
"ticker": "ACMC",
"id": "ACME837275222752952",
"address":
"Anytown USA, 333333"
}
}
}
},
{
"topic": "financial_txns",
"value": {
"id": "2",
"transaction": {
"num_shares": 30000,
"amount": 5004.89,
"txn_ts": "2020-11-18 02:35:43",
"customer": {
"first_name": "Art",
"last_name": "Vandeley",
"id": 8976612,
"email": "avendleay@gmail.com"
},
"company": {
"name": "Imports Corp",
"ticker": "IMPC",
"id": "IMPC88875222752952",
"address": "Anytown USA, 333333"
}
}
}
},
{
"topic": "financial_txns",
"value": {
"id": "3",
"transaction": {
"num_shares": 3000000,
"amount": 600044568.89,
"txn_ts": "2020-11-18 02:36:43",
"customer": {
"first_name": "John",
"last_name": "England",
"id": 456321,
"email": "je@gmail.com"
},
"company": {
"name": "Hechinger",
"ticker": "HECH",
"id": "HECH8333785222752952",
"address":
"Anytown USA, 333333"
}
}
}
},
{
"topic": "financial_txns",
"value": {
"id": "4",
"transaction": {
"num_shares": 10000,
"amount": 80044.89,
"txn_ts": "2020-11-18 02:37:43",
"customer": {
"first_name": "Fred",
"last_name": "Pym",
"id": 333567,
"email": "fjone@gmail.com"
},
"company": {
"name": "PymTech",
"ticker": "PYMT",
"id": "PYME837275222714197419202020",
"address": "Anytown USA, 333333"
}
}
}
}
]
}
Create a file at test/output.json
with the expected outputs:
{
"outputs": [
{
"topic": "FINANCIAL_REPORTS",
"value": {
"SHARES" : 50000,
"CUST_ID": 1234567,
"SYMBOL" : "ACMC"
}
},
{
"topic": "FINANCIAL_REPORTS",
"value": {
"SHARES" : 30000 ,
"CUST_ID": 8976612,
"SYMBOL" : "IMPC"
}
},
{
"topic": "FINANCIAL_REPORTS",
"value": {
"SHARES" : 3000000 ,
"CUST_ID": 456321,
"SYMBOL" : "HECH"
}
},
{
"topic": "FINANCIAL_REPORTS",
"value": {
"SHARES" : 10000 ,
"CUST_ID": 333567,
"SYMBOL" : "PYMT"
}
}
]
}