@Test
public void testWrite() throws Exception {

	Map<String, String> ddmFormFieldsLabel = LinkedHashMapBuilder.put(
		"field1", "Field 1"
	).put(
		"field2", "Field 2"
	).put(
		"field3", "Field 3"
	).put(
		"field4", "Field 4"
	).build();
	List<Map<String, String>> ddmFormFieldValues =
		new ArrayList<Map<String, String>>() {
			{
				add(
					LinkedHashMapBuilder.put(
						"field1", "2"
					).put(
						"field2", "esta é uma 'string'"
					).put(
						"field3", "false"
					).put(
						"field4", "11.7"
					).build());
				add(
					LinkedHashMapBuilder.put(
						"field1", "1"
					).put(
						"field2", "esta é uma 'string'"
					).put(
						"field3", ""
					).put(
						"field4", "10"
					).build());
			}
		};
	DDMFormInstanceRecordWriterRequest.Builder builder =
		DDMFormInstanceRecordWriterRequest.Builder.newBuilder(
			ddmFormFieldsLabel, ddmFormFieldValues);
	DDMFormInstanceRecordCSVWriter ddmFormInstanceRecordCSVWriter =
		new DDMFormInstanceRecordCSVWriter();
	DDMFormInstanceRecordWriterResponse
		ddmFormInstanceRecordWriterResponse =
			ddmFormInstanceRecordCSVWriter.write(builder.build());
	StringBundler sb = new StringBundler(3);
	sb.append("Field 1,Field 2,Field 3,Field 4\n");
	sb.append("2,esta é uma 'string',false,11.7\n");
	sb.append("1,esta é uma 'string',,10");
	String expected = sb.toString();
	Assert.assertArrayEquals(
		expected.getBytes(),
		ddmFormInstanceRecordWriterResponse.getContent());
}