HerdStringUtils { public static String getShortDescription(String description, Integer shortDescMaxLength) { String toParse = description != null ? description : ""; return StringUtils.left(stripHtml(toParse), shortDescMaxLength); }  static String decodeBase64(String base64EncodedText); static String getShortDescription(String description, Integer shortDescMaxLength); static String stripHtml(String fragment, String... whitelistTags); static void checkCsvInjection(String text, String errorMessage); static Integer convertStringToInteger(final String stringValue, final Integer defaultValue); static String sanitizeLogText(String loggingText); static final String HIDDEN_TEXT; }
@Test public void testGetShortDescription() { String longString = RandomStringUtils.randomAlphabetic(500); String result = HerdStringUtils.getShortDescription(longString, 10); assertEquals(result.length(), 10); }