mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-08-18 20:38:02 +08:00
fix code
This commit is contained in:
@@ -2,7 +2,7 @@ package cn.hutool.json;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.reflect.TypeReference;
|
||||
import cn.hutool.core.reflect.TypeReference;
|
||||
import lombok.Data;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import cn.hutool.core.io.resource.ResourceUtil;
|
||||
import cn.hutool.core.lang.reflect.TypeReference;
|
||||
import cn.hutool.core.reflect.TypeReference;
|
||||
import lombok.Data;
|
||||
|
||||
public class Issue488Test {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package cn.hutool.json;
|
||||
|
||||
import cn.hutool.core.lang.reflect.TypeReference;
|
||||
import cn.hutool.core.reflect.TypeReference;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.convert.ConvertException;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.map.Dict;
|
||||
import cn.hutool.core.lang.reflect.TypeReference;
|
||||
import cn.hutool.core.reflect.TypeReference;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.json.test.bean.Exam;
|
||||
import cn.hutool.json.test.bean.JsonNode;
|
||||
@@ -82,7 +82,7 @@ public class JSONArrayTest {
|
||||
|
||||
@Test
|
||||
public void parseFileTest() {
|
||||
JSONArray array = JSONUtil.readJSONArray(FileUtil.file("exam_test.json"), CharsetUtil.CHARSET_UTF_8);
|
||||
JSONArray array = JSONUtil.readJSONArray(FileUtil.file("exam_test.json"), CharsetUtil.UTF_8);
|
||||
|
||||
JSONObject obj0 = array.getJSONObject(0);
|
||||
Exam exam = JSONUtil.toBean(obj0, Exam.class);
|
||||
@@ -107,7 +107,7 @@ public class JSONArrayTest {
|
||||
|
||||
@Test
|
||||
public void toListTest() {
|
||||
String jsonStr = FileUtil.readString("exam_test.json", CharsetUtil.CHARSET_UTF_8);
|
||||
String jsonStr = FileUtil.readString("exam_test.json", CharsetUtil.UTF_8);
|
||||
JSONArray array = JSONUtil.parseArray(jsonStr);
|
||||
|
||||
List<Exam> list = array.toList(Exam.class);
|
||||
@@ -152,7 +152,7 @@ public class JSONArrayTest {
|
||||
|
||||
@Test
|
||||
public void toArrayTest() {
|
||||
String jsonStr = FileUtil.readString("exam_test.json", CharsetUtil.CHARSET_UTF_8);
|
||||
String jsonStr = FileUtil.readString("exam_test.json", CharsetUtil.UTF_8);
|
||||
JSONArray array = JSONUtil.parseArray(jsonStr);
|
||||
|
||||
//noinspection SuspiciousToArrayCall
|
||||
|
||||
@@ -10,8 +10,8 @@ import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.io.resource.ResourceUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.text.StrUtil;
|
||||
import cn.hutool.json.test.bean.JSONBean;
|
||||
import cn.hutool.json.test.bean.ResultDto;
|
||||
import cn.hutool.json.test.bean.Seq;
|
||||
@@ -711,7 +711,7 @@ public class JSONObjectTest {
|
||||
.set("b", "value2");
|
||||
|
||||
final String s = json1.toJSONString(0, (pair) -> {
|
||||
pair.setValue(ObjectUtil.defaultIfNull(pair.getValue(), StrUtil.EMPTY));
|
||||
pair.setValue(ObjUtil.defaultIfNull(pair.getValue(), StrUtil.EMPTY));
|
||||
return true;
|
||||
});
|
||||
Assert.assertEquals("{\"a\":\"\",\"b\":\"value2\"}", s);
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import cn.hutool.core.io.resource.ResourceUtil;
|
||||
import cn.hutool.core.lang.reflect.TypeReference;
|
||||
import cn.hutool.core.reflect.TypeReference;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
|
||||
public class IssueIVMD5Test {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package cn.hutool.json.jwt;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.text.StrUtil;
|
||||
import cn.hutool.json.jwt.signers.JWTSignerUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package cn.hutool.json.test.bean.report;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.core.text.StrUtil;
|
||||
|
||||
/**
|
||||
* 测试步骤报告
|
||||
@@ -10,7 +10,7 @@ import cn.hutool.core.util.StrUtil;
|
||||
*/
|
||||
public class StepReport {
|
||||
private static int step_id = 0;
|
||||
|
||||
|
||||
private int stepId = getId();
|
||||
/**
|
||||
* 步骤名称
|
||||
@@ -40,7 +40,7 @@ public class StepReport {
|
||||
* 测试时间
|
||||
*/
|
||||
private String testTime;
|
||||
|
||||
|
||||
/**
|
||||
* 测试状态:true-成功 false-失败
|
||||
*/
|
||||
@@ -53,7 +53,7 @@ public class StepReport {
|
||||
* 截图路径:相对路径
|
||||
*/
|
||||
private String screenshot;
|
||||
|
||||
|
||||
private static synchronized int getId() {
|
||||
return step_id++;
|
||||
}
|
||||
@@ -69,11 +69,11 @@ public class StepReport {
|
||||
public void setResult(String result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
|
||||
public String getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public String getStepName() {
|
||||
return stepName;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class StepReport {
|
||||
public void setStepName() {
|
||||
this.stepName = this.actionName + (StrUtil.isBlank(this.elementName) ? "" : " => " + this.elementName);
|
||||
}
|
||||
|
||||
|
||||
public String getElementName() {
|
||||
return elementName;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user