【8.3.0】【scanner】【test】更新递归对象的测试

pull/62/head
stylefeng 2024-08-07 14:47:06 +08:00
parent ce9c658835
commit de2d30bbbb
1 changed files with 26 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package cn.stylefeng.roses.kernel.scanner.api;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.lang.TypeReference;
import cn.hutool.core.util.IdUtil;
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.scanner.api.factory.ClassMetaFactory;
import cn.stylefeng.roses.kernel.scanner.api.pojo.CircularObject;
import cn.stylefeng.roses.kernel.scanner.api.pojo.resource.FieldMetadata;
@ -39,4 +40,29 @@ public class TestCircular {
System.out.println(jsonString);
}
@Test
public void testResObj() {
Type type = new TypeReference<ResponseData<CircularObject>>() {
}.getType();
FieldMetadata fieldMetadata = ClassMetaFactory.beginCreateFieldMetadata(type, IdUtil.fastSimpleUUID());
String jsonString = JSON.toJSONString(fieldMetadata, JSONWriter.Feature.PrettyFormat);
System.out.println(jsonString);
}
@Test
public void testResResObj() {
Type type = new TypeReference<ResponseData<ResponseData<CircularObject>>>() {
}.getType();
FieldMetadata fieldMetadata = ClassMetaFactory.beginCreateFieldMetadata(type, IdUtil.fastSimpleUUID());
String jsonString = JSON.toJSONString(fieldMetadata, JSONWriter.Feature.PrettyFormat);
System.out.println(jsonString);
}
}