SelectDDMFormFieldTemplateContextContributor implements DDMFormFieldTemplateContextContributor { protected boolean getMultiple( DDMFormField ddmFormField, DDMFormFieldRenderingContext ddmFormFieldRenderingContext) { Map<String, Object> changedProperties = (Map<String, Object>)ddmFormFieldRenderingContext.getProperty( "changedProperties"); if (changedProperties != null) { Boolean multiple = (Boolean)changedProperties.get("multiple"); if (multiple != null) { return multiple; } } return ddmFormField.isMultiple(); }  @Override Map<String, Object> getParameters(
		DDMFormField ddmFormField,
		DDMFormFieldRenderingContext ddmFormFieldRenderingContext);  }
@Test public void testGetMultiple1() { String fieldName = "field"; DDMFormField ddmFormField = new DDMFormField(fieldName, "select"); ddmFormField.setProperty("multiple", "true"); DDMFormFieldRenderingContext ddmFormFieldRenderingContext = new DDMFormFieldRenderingContext(); ddmFormFieldRenderingContext.setProperty("changedProperties", null); Assert.assertEquals( true, _selectDDMFormFieldTemplateContextContributor.getMultiple( ddmFormField, ddmFormFieldRenderingContext)); }
@Test public void testGetMultiple2() { DDMFormField ddmFormField = new DDMFormField("field", "select"); ddmFormField.setProperty("multiple", "true"); DDMFormFieldRenderingContext ddmFormFieldRenderingContext = new DDMFormFieldRenderingContext(); Map<String, Object> changedProperties = new HashMap<>(); ddmFormFieldRenderingContext.setProperty( "changedProperties", changedProperties); Assert.assertEquals( true, _selectDDMFormFieldTemplateContextContributor.getMultiple( ddmFormField, ddmFormFieldRenderingContext)); }
@Test public void testGetMultiple3() { DDMFormField ddmFormField = new DDMFormField("field", "select"); ddmFormField.setProperty("multiple", "false"); DDMFormFieldRenderingContext ddmFormFieldRenderingContext = new DDMFormFieldRenderingContext(); ddmFormFieldRenderingContext.setProperty( "changedProperties", HashMapBuilder.<String, Object>put( "multiple", true ).build()); Assert.assertEquals( true, _selectDDMFormFieldTemplateContextContributor.getMultiple( ddmFormField, ddmFormFieldRenderingContext)); }