DDMFormInstanceRecordExporterImpl implements DDMFormInstanceRecordExporter { protected Map<String, String> getDDMFormFieldsLabel( Map<String, DDMFormField> ddmFormFieldMap, Locale locale) { Map<String, String> ddmFormFieldsLabel = new LinkedHashMap<>(); Collection<DDMFormField> ddmFormFields = ddmFormFieldMap.values(); Stream<DDMFormField> stream = ddmFormFields.stream(); stream.forEach( field -> { LocalizedValue localizedValue = field.getLabel(); ddmFormFieldsLabel.put( field.getName(), localizedValue.getString(locale)); }); ddmFormFieldsLabel.put(_STATUS, LanguageUtil.get(locale, _STATUS)); ddmFormFieldsLabel.put( _MODIFIED_DATE, LanguageUtil.get(locale, "modified-date")); ddmFormFieldsLabel.put(_AUTHOR, LanguageUtil.get(locale, _AUTHOR)); return ddmFormFieldsLabel; }  @Override DDMFormInstanceRecordExporterResponse export(
			DDMFormInstanceRecordExporterRequest
				ddmFormInstanceRecordExporterRequest);  }
@Test public void testGetDDMFormFieldsLabel() { DDMFormInstanceRecordExporterImpl ddmFormInstanceRecordExporterImpl = new DDMFormInstanceRecordExporterImpl(); Locale locale = new Locale("pt", "BR"); when( _language.get(locale, "status") ).thenReturn( "Estado" ); when( _language.get(locale, "modified-date") ).thenReturn( "Data de Modificação" ); when( _language.get(locale, "author") ).thenReturn( "Autor" ); LocalizedValue localizedValue1 = new LocalizedValue(); localizedValue1.addString(locale, "Campo 1"); LocalizedValue localizedValue2 = new LocalizedValue(); localizedValue2.addString(locale, "Campo 2"); Map<String, DDMFormField> ddmFormFieldMap = HashMapBuilder.<String, DDMFormField>put( "field1", () -> { DDMFormField ddmFormField1 = new DDMFormField( "field1", "text"); ddmFormField1.setLabel(localizedValue1); return ddmFormField1; } ).put( "field2", () -> { DDMFormField ddmFormField2 = new DDMFormField( "field2", "text"); ddmFormField2.setLabel(localizedValue2); return ddmFormField2; } ).build(); Map<String, String> ddmFormFieldsLabel = ddmFormInstanceRecordExporterImpl.getDDMFormFieldsLabel( ddmFormFieldMap, locale); Assert.assertEquals("Campo 1", ddmFormFieldsLabel.get("field1")); Assert.assertEquals("Campo 2", ddmFormFieldsLabel.get("field2")); Assert.assertEquals("Estado", ddmFormFieldsLabel.get("status")); Assert.assertEquals( "Data de Modificação", ddmFormFieldsLabel.get("modifiedDate")); Assert.assertEquals("Autor", ddmFormFieldsLabel.get("author")); }