Created
August 13, 2014 21:25
-
-
Save jnizet/1673c66104f2348349d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EscapeTest { | |
@Test | |
public void jacksonShouldEscape() throws IOException { | |
ObjectMapper om = new ObjectMapper(); | |
String json = "{\"name\": \"O;\\\\l-wslD6RQ5@M)\"}"; | |
Foo foo = om.reader(Foo.class).readValue(json); | |
assertThat(foo.getName()).isEqualTo("O;\\l-wslD6RQ5@M)"); | |
} | |
public static class Foo { | |
private String name; | |
public String getName() { | |
return name; | |
} | |
public void setName(String name) { | |
this.name = name; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment