Created
June 29, 2020 21:08
-
-
Save odrotbohm/125d15ec154a1ac72f74754ef1b03764 to your computer and use it in GitHub Desktop.
Revisions
-
odrotbohm revised this gist
Jun 29, 2020 . No changes.There are no files selected for viewing
-
odrotbohm revised this gist
Jun 29, 2020 . No changes.There are no files selected for viewing
-
odrotbohm created this gist
Jun 29, 2020 .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,20 @@ @SpringBootTest @RequiredArgsConstructor class Sample { private final ObjectMapper jackson; @Test void deserializesThroughConstructor() throws Exception { var result = jackson.readValue("{\"firstname\" : \"Dave\", \"lastname\" : \"Matthews\" }", SomeSample.class); assertThat(result.getFirstname()).isEqualTo("Dave"); assertThat(result.getLastname()).isEqualTo("Matthews"); } @Value static class SomeSample { String firstname, lastname; } }