@Test public void stringIsNull() { String testStr = null; String resultString = constraint.crop(testStr); assertThat(resultString, is(nullValue())); }
public String crop(String string) { if ((null == string) || (string.length() <= effectiveStringLength)) { return string; } if (effectiveStringLength == 0) { return ""; } String cropped = string.substring(0, effectiveStringLength); if (USE_TRAILING_DOTS) { cropped = appendTrailingDots(cropped); } return cropped; }
StringConstraint { public String crop(String string) { if ((null == string) || (string.length() <= effectiveStringLength)) { return string; } if (effectiveStringLength == 0) { return ""; } String cropped = string.substring(0, effectiveStringLength); if (USE_TRAILING_DOTS) { cropped = appendTrailingDots(cropped); } return cropped; } }
StringConstraint { public String crop(String string) { if ((null == string) || (string.length() <= effectiveStringLength)) { return string; } if (effectiveStringLength == 0) { return ""; } String cropped = string.substring(0, effectiveStringLength); if (USE_TRAILING_DOTS) { cropped = appendTrailingDots(cropped); } return cropped; } StringConstraint(Map<String, Object> parameter); }
StringConstraint { public String crop(String string) { if ((null == string) || (string.length() <= effectiveStringLength)) { return string; } if (effectiveStringLength == 0) { return ""; } String cropped = string.substring(0, effectiveStringLength); if (USE_TRAILING_DOTS) { cropped = appendTrailingDots(cropped); } return cropped; } StringConstraint(Map<String, Object> parameter); String crop(String string); Map<String, String[]> crop(final Map<String, String[]> original); String cropKeepFinalCharacter(String string, char finalChar); }
StringConstraint { public String crop(String string) { if ((null == string) || (string.length() <= effectiveStringLength)) { return string; } if (effectiveStringLength == 0) { return ""; } String cropped = string.substring(0, effectiveStringLength); if (USE_TRAILING_DOTS) { cropped = appendTrailingDots(cropped); } return cropped; } StringConstraint(Map<String, Object> parameter); String crop(String string); Map<String, String[]> crop(final Map<String, String[]> original); String cropKeepFinalCharacter(String string, char finalChar);  }