A map data type represents an unordered collection of key-value pair elements. To pass map data through transformations, assign map data type to ports. A map element is a key and value pair that maps one thing to another.
The same as voor the ANY type counts for the Map data type. For this to work within the AppTester you will need to add something in the jSon to be able to assert the data of this type. Please check the following table for information.
This table is also available as an Excel download here.
Map data | IBM BAW | AppTester | Note |
Default template | tw.local.inputData = new tw.object.Map(); |
{ “item”: { “key”: “”, } } |
|
Simple Type (String, Integer, Boolean,…) |
tw.local.inputData = new tw.object.Map(); tw.local.inputData.put(“1”, “Hello”); tw.local.inputData.put(“2”, 2022); tw.local.inputData.put(“3”, true); |
{ “item”: { “key”: “1”, }, “item1”: { “key”: “2”, }, “item2”: { “key”: “3”, }, “item3”: { “key”: “4”, }, “item4”: { “key”: “5”, }, “item5”: { “key”: “6”, } } |
– Map key in BAW to key in Apptester – Map value in BAW to value in Apptester – valueType is the type of value |
Complex Object | We have the address variable wtih Type Address (refer to the sheet Address) tw.local.address = {}; tw.local.address.city = ‘HCM’; tw.local.address.street = ‘NKKN’; tw.local.address.zipCode = ‘2020’; and set it to a MAP tw.local.inputData = new tw.object.Map(); tw.local.inputData.put(“1”, tw.local.address); |
{ “item”: { “key”: “1”, { “city”: “HCM”, { “@type”: “String”, }, “map”: { “item”: { “key”: 1, } } }, } } |
|
Map Array – Complex |
[ { “item”: { “key”: “1”, { “city”: “HCM”, { “@type”: “String”, }, “map”: { “item”: { “key”: 1, } } }, “@type”: “Address” } }, “item”: { “key”: “1”, { “age”: 10, }, } } ] |
||
Map Array – Simple |
tw.local.arrayMap = new tw.object.listOf.Map(); tw.local.arrayMap[1] = new tw.object.Map(); |
[ “item”: { “key”: “1”, }, “item1”: { “key”: “2”, } }, “item”: { “key”: “1”, }, “item1”: { “key”: “2”, } } OR [ “item”: { “key”: “1”, }, “item1”: { “key”: “1”, }, “item2”: { “key”: “2”, } } |
– If the type is list of String or Integer,…. we can input the @type = X[] with X is simple type ==> it’s good with [] or without [] |
Object include Map |
{ “city”: “HCM”, { }, “date”: “1970-01-01T00:00:00.000Z”, { { “key”: “1”, } }, } |
Asserting data
For the map type, asserting the data is using the name of the assert to navigate to the variable you want to assert. For example:

This can be asserted in the assert tab as follows:
