This commit is contained in:
Looly
2022-03-31 18:01:55 +08:00
parent a3b39e4646
commit 5f34b941fa
4 changed files with 53 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
package cn.hutool.json;
import lombok.AllArgsConstructor;
import lombok.Data;
import org.junit.Assert;
import org.junit.Test;
public class IssueI50EGGTest {
@Test
public void toBeanTest(){
String data = "{\"return_code\": 1, \"return_msg\": \"成功\", \"return_data\" : null}";
final ApiResult<?> apiResult = JSONUtil.toBean(data, JSONConfig.create().setIgnoreCase(true), ApiResult.class);
Assert.assertEquals(1, apiResult.getReturn_code());
}
@Data
@AllArgsConstructor
static class ApiResult<T>{
private long Return_code;
private String Return_msg;
private T Return_data;
}
}