@Test
public void testSerializeResources_NoColumnInfo() throws Exception {

  Result result = new ResultImpl(true);
  result.setResultStatus(new ResultStatus(ResultStatus.STATUS.OK));
  TreeNode<Resource> tree = result.getResultTree();
  List<TreeMap<String, Object>> data = new ArrayList<TreeMap<String, Object>>() {
    {
      add(new TreeMap<String, Object>() {
        {
          put("property1", "value1a");
          put("property2", "value2a");
          put("property3", "value3a");
          put("property4", "value4a");
        }
      });
      add(new TreeMap<String, Object>() {
        {
          put("property1", "value1'b");
          put("property2", "value2'b");
          put("property3", "value3'b");
          put("property4", "value4'b");
        }
      });
      add(new TreeMap<String, Object>() {
        {
          put("property1", "value1,c");
          put("property2", "value2,c");
          put("property3", "value3,c");
          put("property4", "value4,c");
        }
      });
    }
  };
  tree.setName("items");
  tree.setProperty("isCollection", "true");
  addChildResource(tree, "resource", 0, data.get(0));
  addChildResource(tree, "resource", 1, data.get(1));
  addChildResource(tree, "resource", 2, data.get(2));
  replayAll();
  //execute test
  Object o = new CsvSerializer().serialize(result).toString().replace("\r", "");
  verifyAll();
  assertNotNull(o);
  StringReader reader = new StringReader(o.toString());
  CSVParser csvParser = new CSVParser(reader, CSVFormat.DEFAULT);
  List<CSVRecord> records = csvParser.getRecords();
  assertNotNull(records);
  assertEquals(3, records.size());
  int i = 0;
  for (CSVRecord record : records) {
    TreeMap<String, Object> actualData = data.get(i++);
    assertEquals(actualData.size(), record.size());
    for (String item : record) {
      assertTrue(actualData.containsValue(item));
    }
  }
  csvParser.close();
}