EscapeUtils { public static String escapeRaw( String text ) { return escapeRaw( text, null ); }  static String escapeJson( String text ); static String escapeJson( String text, DefaultPrettyPrinter prettyPrinter ); static String escapeRaw( String text ); static String escapeRaw( String text, DefaultPrettyPrinter prettyPrinter ); static String escapeJsonOrRaw( String text ); static String escapeJsonOrRaw( String text, DefaultPrettyPrinter prettyPrinter );  }
@Test public void testEscapeRaw_invalidJsonValue() { assertRawTestData( JSON_OBJECT_INVALID_RAW_ESCAPE, JSON_OBJECT_INVALID ); String actual = EscapeUtils.escapeRaw( JSON_OBJECT_INVALID ); assertEquals( JSON_OBJECT_INVALID_RAW_ESCAPE, actual ); }
@Test public void testEscapeRaw_null() { assertNull( EscapeUtils.escapeRaw( null ) ); }
@Test public void testEscapeRaw_simpleValue() { final String text = "\"text\""; final String expected = "\\u0022text\\u0022"; assertRawTestData( expected, text ); String actual = EscapeUtils.escapeRaw( text ); assertEquals( expected, actual ); }
@Test public void testEscapeRaw_jsonArray() { assertRawTestData( JSON_ARRAY_RAW_ESCAPE, JSON_ARRAY ); String actual = EscapeUtils.escapeRaw( JSON_ARRAY ); assertEquals( JSON_ARRAY_RAW_ESCAPE, actual ); }
@Test public void testEscapeRaw_jsonObject() { assertRawTestData( JSON_OBJECT_RAW_ESCAPE, JSON_OBJECT ); String actual = EscapeUtils.escapeRaw( JSON_OBJECT ); assertEquals( JSON_OBJECT_RAW_ESCAPE, actual ); }
@Test public void testEscapeJsonOrRaw_invalidJsonValue() { assertRawTestData( JSON_OBJECT_INVALID_RAW_ESCAPE, JSON_OBJECT_INVALID ); String actual = EscapeUtils.escapeRaw( JSON_OBJECT_INVALID ); assertEquals( JSON_OBJECT_INVALID_RAW_ESCAPE, actual ); }