From c499ecee27d45287aa0ae0e49489a5b55ffae367 Mon Sep 17 00:00:00 2001 From: Ahmed Tawila Date: Sat, 1 Jul 2017 07:48:27 +0300 Subject: [PATCH] BAEL-972 - Apache Commons Text (#2186) * Evaluation article: Different Types of Bean Injection in Spring * added tests & changed configuration to Java-based config * removed xml config files * rename unit tests * BAEL-972 - Apache Commons Text * remove code from evaluation article * remove code from evaluation article * BAEL-972 - Apache Commons Text - added another example --- .../com/baeldung/text/UnicodeEscaperTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 libraries/src/test/java/com/baeldung/text/UnicodeEscaperTest.java diff --git a/libraries/src/test/java/com/baeldung/text/UnicodeEscaperTest.java b/libraries/src/test/java/com/baeldung/text/UnicodeEscaperTest.java new file mode 100644 index 0000000000..5a52bfd0db --- /dev/null +++ b/libraries/src/test/java/com/baeldung/text/UnicodeEscaperTest.java @@ -0,0 +1,16 @@ +package com.baeldung.text; + +import org.apache.commons.text.translate.UnicodeEscaper; +import org.junit.Assert; +import org.junit.Test; + +public class UnicodeEscaperTest { + + @Test + public void whenTranslate_thenCorrect() { + UnicodeEscaper ue = UnicodeEscaper.above(0); + String result = ue.translate("ABCD"); + + Assert.assertEquals("\\u0041\\u0042\\u0043\\u0044", result); + } +}