mirror of
https://gitee.com/dromara/hutool.git
synced 2025-07-16 16:50:45 +08:00
add test
This commit is contained in:
parent
050021912b
commit
701120b169
@ -0,0 +1,25 @@
|
|||||||
|
package org.dromara.hutool.json;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.junit.jupiter.api.Assertions;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class IssueI8NMP7Test {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void toBeanTest() {
|
||||||
|
final String jsonString = "{\"enableTime\":\"1702262524444\"}";
|
||||||
|
final DemoModel bean = JSONUtil.toBean(jsonString, JSONConfig.of().setDateFormat("#SSS"), DemoModel.class);
|
||||||
|
Assertions.assertNotNull(bean.getEnableTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
static class DemoModel{
|
||||||
|
private Date enableTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user