@Test public void testCutValueNull() throws ServletException, IOException { this.testTarget = new AbstractMDCPutFilter() { @Override protected String getMDCKey(HttpServletRequest request, HttpServletResponse response) { return "MDCKey"; } @Override protected String getMDCValue(HttpServletRequest request, HttpServletResponse response) { return "MDCValue"; } }; assertThat(testTarget.cutValue(null), is(nullValue())); }
protected String cutValue(String value) { if (value != null && maxMDCValueLength >= 0 && value .length() > maxMDCValueLength) { return value.substring(0, maxMDCValueLength); } else { return value; } }
AbstractMDCPutFilter extends OncePerRequestFilter { protected String cutValue(String value) { if (value != null && maxMDCValueLength >= 0 && value .length() > maxMDCValueLength) { return value.substring(0, maxMDCValueLength); } else { return value; } } }
AbstractMDCPutFilter extends OncePerRequestFilter { protected String cutValue(String value) { if (value != null && maxMDCValueLength >= 0 && value .length() > maxMDCValueLength) { return value.substring(0, maxMDCValueLength); } else { return value; } }  }
AbstractMDCPutFilter extends OncePerRequestFilter { protected String cutValue(String value) { if (value != null && maxMDCValueLength >= 0 && value .length() > maxMDCValueLength) { return value.substring(0, maxMDCValueLength); } else { return value; } }  void setRemoveValue(boolean removeValue); void setMaxMDCValueLength(int maxMDCValueLength); }
AbstractMDCPutFilter extends OncePerRequestFilter { protected String cutValue(String value) { if (value != null && maxMDCValueLength >= 0 && value .length() > maxMDCValueLength) { return value.substring(0, maxMDCValueLength); } else { return value; } }  void setRemoveValue(boolean removeValue); void setMaxMDCValueLength(int maxMDCValueLength);  }