public class MongoStorageTest {
@Test
public void testMap() throws Exception {
MongoStorage ms = new MongoStorage();
BasicDBObjectBuilder builder = BasicDBObjectBuilder.start();
ResourceSchema schema = new ResourceSchema(Utils.getSchemaFromString("m:map[]"));
Map<String, Object> val = new HashMap<String, Object>();
val.put("f1", 1);
val.put("f2", "2");
ms.writeField(builder, schema.getFields()[0], val);
DBObject out = builder.get();
Set<String> outKeySet = out.keySet();
assertEquals(2, outKeySet.size());
assertEquals(1, out.get("f1"));