use of com.linkedin.data.template.StringArrayMap in project rest.li by linkedin.
the class TestMap method testStringArrayMap.
@Test
public void testStringArrayMap() {
TestDataTemplateUtil.FieldInfo fieldInfo = TestDataTemplateUtil.fieldInfo(new MapTest(), "stringArrayMap");
@SuppressWarnings("unchecked") Class<StringArrayMap> templateClass = (Class<StringArrayMap>) fieldInfo.getFieldClass();
MapDataSchema schema = (MapDataSchema) fieldInfo.getField().getType();
Map<String, StringArray> input = new HashMap<String, StringArray>();
for (int i = 0; i < 5; ++i) {
String key = "input" + i;
input.put(key, new StringArray());
input.get(key).add("subinput" + i);
}
Map<String, StringArray> adds = new HashMap<String, StringArray>();
for (int i = 0; i < 5; ++i) {
String key = "add" + i;
adds.put(key, new StringArray());
adds.get(key).add("subadd" + i);
}
TestMapTemplate.testMap(templateClass, schema, input, adds);
}
Aggregations