DateDDMFormFieldValueRenderer implements DDMFormFieldValueRenderer { @Override public String render(DDMFormFieldValue ddmFormFieldValue, Locale locale) { Value value = ddmFormFieldValue.getValue(); return render(value.getString(locale), locale); }  @Override String render(DDMFormFieldValue ddmFormFieldValue, Locale locale);  }
@Test public void testRender() { DDMForm ddmForm = DDMFormTestUtil.createDDMForm(); DDMFormField ddmFormField = DDMFormTestUtil.createDDMFormField( "birthday", "Birthday", "date", "string", false, false, false); ddmForm.addDDMFormField(ddmFormField); DDMFormValues ddmFormValues = DDMFormValuesTestUtil.createDDMFormValues( ddmForm); DDMFormFieldValue ddmFormFieldValue = DDMFormValuesTestUtil.createDDMFormFieldValue( "birthday", new UnlocalizedValue("2015-01-25")); ddmFormValues.addDDMFormFieldValue(ddmFormFieldValue); DateDDMFormFieldValueRenderer dateDDMFormFieldValueRenderer = new DateDDMFormFieldValueRenderer(); Assert.assertEquals( "1/25/15", dateDDMFormFieldValueRenderer.render( ddmFormFieldValue, LocaleUtil.US)); Assert.assertEquals( "25/01/15", dateDDMFormFieldValueRenderer.render( ddmFormFieldValue, LocaleUtil.BRAZIL)); ddmFormFieldValue.setValue(new UnlocalizedValue("")); Assert.assertEquals( StringPool.BLANK, dateDDMFormFieldValueRenderer.render( ddmFormFieldValue, LocaleUtil.US)); }