CompositeRequestDataValueProcessor implements
                                                RequestDataValueProcessor { @Override public String processFormFieldValue(HttpServletRequest request, String name, String value, String type) { String result = value; for (RequestDataValueProcessor processor : processors) { result = processor.processFormFieldValue(request, name, value, type); if (!value.equals(result)) { break; } } return result; } CompositeRequestDataValueProcessor(
            RequestDataValueProcessor... processors); String processAction(HttpServletRequest request, String action); @Override String processAction(HttpServletRequest request, String action,
            String method); @Override String processFormFieldValue(HttpServletRequest request, String name,
            String value, String type); @Override Map<String, String> getExtraHiddenFields(
            HttpServletRequest request); @Override String processUrl(HttpServletRequest request, String url);  }
@Test public void testProcessFormFieldValueSameValueAndResult() { when(requestDataValueProcessor.processFormFieldValue(any( HttpServletRequest.class), anyString(), anyString(), anyString())).thenReturn("value"); String result = compositeRequestDataValueProcessor .processFormFieldValue(request, "", "value", ""); assertThat(result, is("value")); }
@Test public void testProcessFormFieldValueDifferentValueAndResult() { when(requestDataValueProcessor.processFormFieldValue(any( HttpServletRequest.class), anyString(), anyString(), anyString())).thenReturn("other_value"); String result = compositeRequestDataValueProcessor .processFormFieldValue(request, "", "value", ""); assertThat(result, is("other_value")); }
@Test public void testProcessFormFieldValueNoProcessors() { compositeRequestDataValueProcessor = new CompositeRequestDataValueProcessor(); String result = compositeRequestDataValueProcessor .processFormFieldValue(request, "", "value", ""); assertThat(result, is("value")); }