From 32e0d57ff6c7a9a86f860b28c1bf5a2ea9da9ddb Mon Sep 17 00:00:00 2001 From: looly Date: Wed, 5 Jan 2022 18:51:00 +0800 Subject: [PATCH] fix tst --- hutool-json/src/test/java/cn/hutool/json/Issue644Test.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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