@Test
public void testGetDDMFormFieldValue() throws Exception {

	DDMFormInstanceRecordExporterImpl ddmFormInstanceRecordExporterImpl =
		new DDMFormInstanceRecordExporterImpl();
	ddmFormInstanceRecordExporterImpl.ddmFormFieldTypeServicesTracker =
		_ddmFormFieldTypeServicesTracker;
	DDMFormFieldValueRenderer ddmFormFieldValueRenderer = mock(
		DDMFormFieldValueRenderer.class);
	DDMFormField ddmFormField = new DDMFormField("field1", "text");
	List<DDMFormFieldValue> ddmFormFieldValues = new ArrayList<>();
	DDMFormFieldValue ddmFormFieldValue =
		DDMFormValuesTestUtil.createDDMFormFieldValue(
			"field1", new UnlocalizedValue("value1"));
	ddmFormFieldValues.add(ddmFormFieldValue);
	Map<String, List<DDMFormFieldValue>> ddmFormFieldValueMap =
		HashMapBuilder.<String, List<DDMFormFieldValue>>put(
			"field1", ddmFormFieldValues
		).build();
	Locale locale = new Locale("pt", "BR");
	when(
		_ddmFormFieldTypeServicesTracker.getDDMFormFieldValueRenderer(
			"text")
	).thenReturn(
		ddmFormFieldValueRenderer
	);
	when(
		ddmFormFieldValueRenderer.render(ddmFormFieldValue, locale)
	).thenReturn(
		"value1"
	);
	when(
		_html.render("value1")
	).thenReturn(
		"value1"
	);
	String actualValue =
		ddmFormInstanceRecordExporterImpl.getDDMFormFieldValue(
			ddmFormField, ddmFormFieldValueMap, locale);
	Assert.assertEquals("value1", actualValue);
	Mockito.verify(
		_ddmFormFieldTypeServicesTracker, Mockito.times(1)
	).getDDMFormFieldValueRenderer(
		"text"
	);
	Mockito.verify(
		ddmFormFieldValueRenderer, Mockito.times(1)
	).render(
		ddmFormFieldValue, locale
	);
	Mockito.verify(
		_html, Mockito.times(1)
	).render(
		"value1"
	);
}