-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- B verifyAsJson() handles null LocalTimeDates.
Fixes #531
- Loading branch information
Showing
3 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
approvaltests-tests/src/test/java/org/approvaltests/JsonApprovalsTest.java
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.approvaltests; | ||
|
||
import com.spun.util.Wrapper; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
public class JsonApprovalsTest { | ||
@Test | ||
void nullDateTest() { | ||
LocalDateWrapper localDateWrapper = new LocalDateWrapper(); | ||
JsonApprovals.verifyAsJson(localDateWrapper, g -> g.serializeNulls()); | ||
} | ||
|
||
private class LocalDateWrapper { | ||
public LocalDateTime getLocalDate() { | ||
return localDate; | ||
} | ||
|
||
public void setLocalDate(LocalDateTime localDate) { | ||
this.localDate = localDate; | ||
} | ||
|
||
private LocalDateTime localDate; | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...ltests-tests/src/test/java/org/approvaltests/JsonApprovalsTest.nullDateTest.approved.json
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"localDate": null | ||
} |
This file contains 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 characters