@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")); }
@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 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 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); }
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); }
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);  }