mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
修复HttpDownloader全局超时无效问题
This commit is contained in:
parent
88cf47b5bb
commit
5a1b50f1de
@ -46,6 +46,7 @@ public class HttpDownloader {
|
||||
* @param url 请求的url
|
||||
* @param timeout 超时毫秒数
|
||||
* @return 文件数据
|
||||
* @since 5.8.28
|
||||
*/
|
||||
public static byte[] downloadBytes(String url, int timeout) {
|
||||
return requestDownload(url, timeout).bodyBytes();
|
||||
|
29
hutool-json/src/test/java/cn/hutool/json/BeanToJsonTest.java
Normal file
29
hutool-json/src/test/java/cn/hutool/json/BeanToJsonTest.java
Normal file
@ -0,0 +1,29 @@
|
||||
package cn.hutool.json;
|
||||
|
||||
import lombok.Data;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class BeanToJsonTest {
|
||||
@Test
|
||||
public void toJsonStrTest() {
|
||||
final ReadParam readParam = new ReadParam();
|
||||
readParam.setInitSpikeMac("a");
|
||||
readParam.setMac("b");
|
||||
readParam.setSpikeMac("c");
|
||||
readParam.setBag("d");
|
||||
readParam.setProjectId(123);
|
||||
|
||||
//Console.log(JSONUtil.toJsonStr(readParam));
|
||||
Assert.assertEquals("{\"initSpikeMac\":\"a\",\"mac\":\"b\",\"spikeMac\":\"c\",\"bag\":\"d\",\"projectId\":123}", JSONUtil.toJsonStr(readParam));
|
||||
}
|
||||
|
||||
@Data
|
||||
private static class ReadParam{
|
||||
private String initSpikeMac;
|
||||
private String mac;
|
||||
private String spikeMac;
|
||||
private String bag;
|
||||
private Integer projectId;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user