-
Notifications
You must be signed in to change notification settings - Fork 490
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug fix for jsonb skip LocalDate, for issue #2907
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
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
26 changes: 26 additions & 0 deletions
26
core/src/test/java/com/alibaba/fastjson2/issues_2900/Issue2907.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 com.alibaba.fastjson2.issues_2900; | ||
|
||
import com.alibaba.fastjson2.JSONB; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.time.LocalDate; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
public class Issue2907 { | ||
@Test | ||
public void test() { | ||
Bean bean = new Bean(); | ||
bean.date = LocalDate.now(); | ||
byte[] bytes = JSONB.toBytes(bean); | ||
Bean1 bean1 = JSONB.parseObject(bytes, Bean1.class); | ||
assertNotNull(bean1); | ||
} | ||
|
||
public static class Bean { | ||
public LocalDate date; | ||
} | ||
|
||
public static class Bean1 { | ||
} | ||
} |