Skip to content

Instantly share code, notes, and snippets.

@plastiv
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plastiv/d8478ba1103c9c9c0378 to your computer and use it in GitHub Desktop.
Save plastiv/d8478ba1103c9c9c0378 to your computer and use it in GitHub Desktop.
public class Vim430TestCase extends TestCase {
private ObjectMapper objectMapper;
@Override protected void setUp() throws Exception {
super.setUp();
objectMapper = ObjectMapperFactory.create();
}
public void testMapping() {
String addressJson = "{" +
"\"city\": \"Berlin\"," +
"\"lines\": [\"Deutschland\"," +
"\"10405 Berlin\"," +
"\"Prenzlauer Allee 3\"]," +
"\"country\": \"Deutschland\"" +
"}";
try {
Address address = objectMapper.readValue(addressJson, Address.class);
assertThat(address.getLines()).hasSize(3);
} catch (IOException e) {
fail(e.getMessage());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment