File tree Expand file tree Collapse file tree 2 files changed +23
-18
lines changed
approvaltests-tests/src/test/java/org/approvaltests
approvaltests-util/src/main/java/com/spun/util Expand file tree Collapse file tree 2 files changed +23
-18
lines changed Original file line number Diff line number Diff line change 55
66import java .time .LocalDateTime ;
77
8- public class JsonApprovalsTest {
9- @ Test
10- void nullDateTest () {
11- LocalDateWrapper localDateWrapper = new LocalDateWrapper ();
12- JsonApprovals .verifyAsJson (localDateWrapper , g -> g .serializeNulls ());
8+ public class JsonApprovalsTest
9+ {
10+ @ Test
11+ void nullDateTest ()
12+ {
13+ LocalDateWrapper localDateWrapper = new LocalDateWrapper ();
14+ JsonApprovals .verifyAsJson (localDateWrapper , g -> g .serializeNulls ());
15+ }
16+ private class LocalDateWrapper
17+ {
18+ public LocalDateTime getLocalDate ()
19+ {
20+ return localDate ;
1321 }
14-
15- private class LocalDateWrapper {
16- public LocalDateTime getLocalDate () {
17- return localDate ;
18- }
19-
20- public void setLocalDate (LocalDateTime localDate ) {
21- this .localDate = localDate ;
22- }
23-
24- private LocalDateTime localDate ;
22+ public void setLocalDate (LocalDateTime localDate )
23+ {
24+ this .localDate = localDate ;
2525 }
26+ private LocalDateTime localDate ;
27+ }
2628}
Original file line number Diff line number Diff line change @@ -112,9 +112,12 @@ public static class LocalDateTimeAdapter extends TypeAdapter<LocalDateTime>
112112 @ Override
113113 public void write (JsonWriter jsonWriter , LocalDateTime instant ) throws IOException
114114 {
115- if (instant == null ) {
115+ if (instant == null )
116+ {
116117 jsonWriter .nullValue ();
117- } else {
118+ }
119+ else
120+ {
118121 jsonWriter .value ("" + instant );
119122 }
120123 }
You can’t perform that action at this time.
0 commit comments