diff --git a/hutool-json/src/test/java/cn/hutool/json/Issue644Test.java b/hutool-json/src/test/java/cn/hutool/json/Issue644Test.java index 83b0a2b55..6371fbe13 100644 --- a/hutool-json/src/test/java/cn/hutool/json/Issue644Test.java +++ b/hutool-json/src/test/java/cn/hutool/json/Issue644Test.java @@ -1,5 +1,6 @@ package cn.hutool.json; +import cn.hutool.core.date.LocalDateTimeUtil; import lombok.Data; import org.junit.Assert; import org.junit.Test; @@ -19,10 +20,12 @@ public class Issue644Test { final JSONObject jsonObject = JSONUtil.parseObj(beanWithDate); BeanWithDate beanWithDate2 = JSONUtil.toBean(jsonObject, BeanWithDate.class); - Assert.assertEquals(beanWithDate.getDate(), beanWithDate2.getDate()); + Assert.assertEquals(LocalDateTimeUtil.formatNormal(beanWithDate.getDate()), + LocalDateTimeUtil.formatNormal(beanWithDate2.getDate())); beanWithDate2 = JSONUtil.toBean(jsonObject.toString(), BeanWithDate.class); - Assert.assertEquals(beanWithDate.getDate(), beanWithDate2.getDate()); + Assert.assertEquals(LocalDateTimeUtil.formatNormal(beanWithDate.getDate()), + LocalDateTimeUtil.formatNormal(beanWithDate2.getDate())); } @Data