11package org .baeldung .jackson .deserialization ;
22
3- import java .io .IOException ;
4- import java .text .DateFormat ;
5- import java .text .SimpleDateFormat ;
3+ import com .fasterxml .jackson .databind .ObjectMapper ;
64import org .baeldung .jackson .entities .Movie ;
75import org .junit .Assert ;
86import org .junit .Test ;
97
10- import com . fasterxml . jackson . core . JsonParseException ;
11- import com . fasterxml . jackson . databind . JsonMappingException ;
12- import com . fasterxml . jackson . databind . ObjectMapper ;
8+ import java . io . IOException ;
9+ import java . text . DateFormat ;
10+ import java . text . SimpleDateFormat ;
1311
1412public class JacksonDeserializeTest {
1513
1614 @ Test
17- public void whenSimpleDeserialize_thenCorrect () throws JsonParseException , JsonMappingException , IOException {
15+ public void whenSimpleDeserialize_thenCorrect () throws IOException {
1816
1917 String jsonInput = "{\" imdbId\" :\" tt0472043\" ,\" actors\" :[{\" imdbId\" :\" nm2199632\" ,\" dateOfBirth\" :\" 1982-09-21T12:00:00+01:00\" ,\" filmography\" :[\" Apocalypto\" ,\" Beatdown\" ,\" Wind Walkers\" ]}]}" ;
2018 ObjectMapper mapper = new ObjectMapper ();
@@ -25,7 +23,7 @@ public void whenSimpleDeserialize_thenCorrect() throws JsonParseException, JsonM
2523 }
2624
2725 @ Test
28- public void whenCustomDeserialize_thenCorrect () throws JsonParseException , JsonMappingException , IOException {
26+ public void whenCustomDeserialize_thenCorrect () throws IOException {
2927
3028 String jsonInput = "{\" imdbId\" :\" tt0472043\" ,\" director\" :\" Mel Gibson\" ,\" actors\" :[{\" imdbId\" :\" nm2199632\" ,\" dateOfBirth\" :\" 1982-09-21T12:00:00+01:00\" ,\" filmography\" :[\" Apocalypto\" ,\" Beatdown\" ,\" Wind Walkers\" ]}]}" ;
3129
0 commit comments