Remove unnecessary throws clauses
This commit is contained in:
parent
feb53db0e6
commit
0d2137f19e
@ -1,20 +1,18 @@
|
|||||||
package org.baeldung.jackson.deserialization;
|
package org.baeldung.jackson.deserialization;
|
||||||
|
|
||||||
import java.io.IOException;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import java.text.DateFormat;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import org.baeldung.jackson.entities.Movie;
|
import org.baeldung.jackson.entities.Movie;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonParseException;
|
import java.io.IOException;
|
||||||
import com.fasterxml.jackson.databind.JsonMappingException;
|
import java.text.DateFormat;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import java.text.SimpleDateFormat;
|
||||||
|
|
||||||
public class JacksonDeserializeTest {
|
public class JacksonDeserializeTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenSimpleDeserialize_thenCorrect() throws JsonParseException, JsonMappingException, IOException {
|
public void whenSimpleDeserialize_thenCorrect() throws IOException {
|
||||||
|
|
||||||
String jsonInput = "{\"imdbId\":\"tt0472043\",\"actors\":[{\"imdbId\":\"nm2199632\",\"dateOfBirth\":\"1982-09-21T12:00:00+01:00\",\"filmography\":[\"Apocalypto\",\"Beatdown\",\"Wind Walkers\"]}]}";
|
String jsonInput = "{\"imdbId\":\"tt0472043\",\"actors\":[{\"imdbId\":\"nm2199632\",\"dateOfBirth\":\"1982-09-21T12:00:00+01:00\",\"filmography\":[\"Apocalypto\",\"Beatdown\",\"Wind Walkers\"]}]}";
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
@ -25,7 +23,7 @@ public class JacksonDeserializeTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void whenCustomDeserialize_thenCorrect() throws JsonParseException, JsonMappingException, IOException {
|
public void whenCustomDeserialize_thenCorrect() throws IOException {
|
||||||
|
|
||||||
String jsonInput = "{\"imdbId\":\"tt0472043\",\"director\":\"Mel Gibson\",\"actors\":[{\"imdbId\":\"nm2199632\",\"dateOfBirth\":\"1982-09-21T12:00:00+01:00\",\"filmography\":[\"Apocalypto\",\"Beatdown\",\"Wind Walkers\"]}]}";
|
String jsonInput = "{\"imdbId\":\"tt0472043\",\"director\":\"Mel Gibson\",\"actors\":[{\"imdbId\":\"nm2199632\",\"dateOfBirth\":\"1982-09-21T12:00:00+01:00\",\"filmography\":[\"Apocalypto\",\"Beatdown\",\"Wind Walkers\"]}]}";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user