HerdStringUtils { public static String decodeBase64(String base64EncodedText) { return StringUtils.toEncodedString(Base64.getDecoder().decode(base64EncodedText.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8); }  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 testDecodeBase64() { assertEquals("UT_SomeText", HerdStringUtils.decodeBase64("VVRfU29tZVRleHQ=")); String encodedText = StringUtils.toEncodedString(Base64.getEncoder().encode(STRING_VALUE.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8); assertEquals(STRING_VALUE, HerdStringUtils.decodeBase64(encodedText)); }