mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix convert bug
This commit is contained in:
@@ -2,6 +2,7 @@ package cn.hutool.core.convert;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateException;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
import cn.hutool.core.util.ByteUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -310,4 +311,10 @@ public class ConvertTest {
|
||||
final Date date = Convert.toDate("2021-01");
|
||||
Assert.assertNull(date);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void toSqlDateTest(){
|
||||
final java.sql.Date date = Convert.convert(java.sql.Date.class, DateUtil.parse("2021-07-28"));
|
||||
Assert.assertEquals("2021-07-28", date.toString());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user