CheckboxDDMFormFieldValueRenderer implements DDMFormFieldValueRenderer { @Override public String render(DDMFormFieldValue ddmFormFieldValue, Locale locale) { Boolean valueBoolean = checkboxDDMFormFieldValueAccessor.getValue( ddmFormFieldValue, locale); if (valueBoolean == Boolean.TRUE) { return LanguageUtil.get(locale, "yes"); } return LanguageUtil.get(locale, "no"); }  @Override String render(DDMFormFieldValue ddmFormFieldValue, Locale locale);  }
@Test public void testRender() throws Exception { DDMFormFieldValue ddmFormFieldValue = DDMFormValuesTestUtil.createDDMFormFieldValue( "Checkbox", new UnlocalizedValue("true")); CheckboxDDMFormFieldValueRenderer checkboxDDMFormFieldValueRenderer = createCheckboxDDMFormFieldValueRenderer(); String expectedCheckboxRenderedValue = LanguageUtil.get( LocaleUtil.US, "yes"); Assert.assertEquals( expectedCheckboxRenderedValue, checkboxDDMFormFieldValueRenderer.render( ddmFormFieldValue, LocaleUtil.US)); ddmFormFieldValue.setValue(new UnlocalizedValue("false")); expectedCheckboxRenderedValue = LanguageUtil.get(LocaleUtil.US, "no"); Assert.assertEquals( expectedCheckboxRenderedValue, checkboxDDMFormFieldValueRenderer.render( ddmFormFieldValue, LocaleUtil.US)); }