mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
24
hutool-json/src/test/java/cn/hutool/json/IssueI50EGGTest.java
Executable file
24
hutool-json/src/test/java/cn/hutool/json/IssueI50EGGTest.java
Executable 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user