fix(接口测试): 解决转json时boolean类型的处理问题

This commit is contained in:
guoyuqi 2022-10-13 11:04:23 +08:00 committed by xiaomeinvG
parent 8de22c1bec
commit 09a755ebde

View File

@ -85,6 +85,8 @@ public class JSONUtil {
typeObj = Integer.class.getConstructor(int.class).newInstance(10);
} else if (StringUtils.containsIgnoreCase(typeClazz.getSimpleName(), "Map")) {
typeObj = LinkedHashMap.class.getConstructor().newInstance();
} else if (StringUtils.containsIgnoreCase(typeClazz.getSimpleName(), PropertyConstant.BOOLEAN)) {
typeObj = Boolean.class.getConstructor(boolean.class).newInstance(false);
} else {
typeObj = typeClazz.getDeclaredConstructor().newInstance();
}