Last active
October 14, 2019 12:51
-
-
Save leonardocregis/4d973a20caec78c3f3ee9a46fbd781c4 to your computer and use it in GitHub Desktop.
Revisions
-
leonardocregis revised this gist
Oct 14, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import org.junit.Test; import static org.junit.Assert.assertNotNull; public class ResponseTest { @Test public void testParseJson() throws IOException { -
leonardocregis created this gist
Sep 5, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import org.junit.Test; import static org.junit.Assert.assertNotNull; public class TT080DgiiOrderResponseTest { @Test public void testParseJson() throws IOException { String jsonData = "{\n" + " \"total\": 100," + " \"val\": 2000," + "}"; ObjectMapper objectMapper = new ObjectMapper(); TT080DgiiOrderResponse response = objectMapper.readValue(jsonData, JsonMapped.class); assertNotNull(response); } } ..... import com.fasterxml.jackson.annotation.JsonProperty; public class JsonMapped { @JsonProperty("total") private Long total @JsonProperty("val") private Long value; }