CheckboxDDMFormFieldValueRequestParameterRetriever implements DDMFormFieldValueRequestParameterRetriever { @Override public String get( HttpServletRequest httpServletRequest, String ddmFormFieldParameterName, String defaultDDMFormFieldParameterValue) { String parameterValue = httpServletRequest.getParameter( ddmFormFieldParameterName); if (parameterValue == null) { return defaultDDMFormFieldParameterValue; } return String.valueOf(GetterUtil.getBoolean(parameterValue)); }  @Override String get(
		HttpServletRequest httpServletRequest, String ddmFormFieldParameterName,
		String defaultDDMFormFieldParameterValue);  }
@Test public void testGetRequestParameterValueFalse() { MockHttpServletRequest request = new MockHttpServletRequest(); String expectedParameterValue = StringPool.FALSE; request.addParameter("ddmFormFieldCheckbox", expectedParameterValue); String defaultParameterValue = StringPool.TRUE; String actualParameterValue = _checkboxDDMFormFieldValueRequestParameterRetriever.get( request, "ddmFormFieldCheckbox", defaultParameterValue); Assert.assertEquals(expectedParameterValue, actualParameterValue); }
@Test public void testGetRequestParameterValueTrue() { MockHttpServletRequest request = new MockHttpServletRequest(); String expectedParameterValue = StringPool.TRUE; request.addParameter("ddmFormFieldCheckbox", expectedParameterValue); String defaultParameterValue = StringPool.FALSE; String actualParameterValue = _checkboxDDMFormFieldValueRequestParameterRetriever.get( request, "ddmFormFieldCheckbox", defaultParameterValue); Assert.assertEquals(expectedParameterValue, actualParameterValue); }
@Test public void testGetValueWithNullRequestParameter() { MockHttpServletRequest request = new MockHttpServletRequest(); String defaultParameterValue = StringPool.TRUE; String parameterValue = _checkboxDDMFormFieldValueRequestParameterRetriever.get( request, "ddmFormFieldCheckbox", defaultParameterValue); Assert.assertEquals(parameterValue, defaultParameterValue); }