add session

This commit is contained in:
Looly
2023-09-21 21:14:00 +08:00
parent 8d7b890b3e
commit 8a0e477f69
39 changed files with 707 additions and 238 deletions

View File

@@ -13,8 +13,8 @@
package org.dromara.hutool.http.client;
import org.dromara.hutool.core.lang.Console;
import org.dromara.hutool.http.HttpUtil;
import org.dromara.hutool.http.client.engine.ClientEngine;
import org.dromara.hutool.http.client.engine.httpclient4.HttpClient4Engine;
import org.dromara.hutool.http.meta.Method;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@@ -25,7 +25,7 @@ public class HttpClient4EngineTest {
@Test
@Disabled
public void getTest() {
final ClientEngine engine = new HttpClient4Engine();
final ClientEngine engine = HttpUtil.createClient("httpclient4");
final Request req = Request.of("https://www.hutool.cn/").method(Method.GET);
final Response res = engine.send(req);

View File

@@ -13,8 +13,8 @@
package org.dromara.hutool.http.client;
import org.dromara.hutool.core.lang.Console;
import org.dromara.hutool.http.HttpUtil;
import org.dromara.hutool.http.client.engine.ClientEngine;
import org.dromara.hutool.http.client.engine.httpclient5.HttpClient5Engine;
import org.dromara.hutool.http.meta.Method;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@@ -25,7 +25,7 @@ public class HttpClient5EngineTest {
@Test
@Disabled
public void getTest() {
final ClientEngine engine = new HttpClient5Engine();
final ClientEngine engine = HttpUtil.createClient("httpclient5");
final Request req = Request.of("https://www.hutool.cn/").method(Method.GET);
final Response res = engine.send(req);

View File

@@ -13,9 +13,8 @@
package org.dromara.hutool.http.client;
import org.dromara.hutool.core.lang.Console;
import org.dromara.hutool.http.HttpUtil;
import org.dromara.hutool.http.client.engine.ClientEngine;
import org.dromara.hutool.http.client.engine.httpclient4.HttpClient4Engine;
import org.dromara.hutool.http.client.engine.okhttp.OkHttpEngine;
import org.dromara.hutool.http.meta.Method;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@@ -25,7 +24,7 @@ public class Issue3240Test {
@Disabled
void okHttpTest() {
String url = "https://gh.yubue.cn/https://github.com/espressif/arduino-esp32/releases/download/2.0.11/package_esp32_dev_index.json";
final ClientEngine engine = new OkHttpEngine();
final ClientEngine engine = HttpUtil.createClient("okhttp");
final Response send = engine.send(Request.of(url).method(Method.GET));
Console.log(send.body().getString());
}
@@ -34,7 +33,7 @@ public class Issue3240Test {
@Disabled
void httpClient4Test() {
String url = "https://gh.yubue.cn/https://github.com/espressif/arduino-esp32/releases/download/2.0.11/package_esp32_dev_index.json";
final ClientEngine engine = new HttpClient4Engine();
final ClientEngine engine = HttpUtil.createClient("okhttp");
final Response send = engine.send(Request.of(url).method(Method.GET));
Console.log(send.body().getString());
}

View File

@@ -20,7 +20,7 @@ import org.junit.jupiter.api.Test;
public class IssueI7ZRJUTest {
@SuppressWarnings({"resource", "TestFailedLine"})
@SuppressWarnings({"resource"})
@Test
@Disabled
void getBadSSlTest() {

View File

@@ -13,8 +13,8 @@
package org.dromara.hutool.http.client;
import org.dromara.hutool.core.lang.Console;
import org.dromara.hutool.http.HttpUtil;
import org.dromara.hutool.http.client.engine.ClientEngine;
import org.dromara.hutool.http.client.engine.jdk.JdkClientEngine;
import org.dromara.hutool.http.meta.Method;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
@@ -24,7 +24,7 @@ public class JdkEngineTest {
@Test
@Disabled
public void getTest(){
final ClientEngine engine = new JdkClientEngine();
final ClientEngine engine = HttpUtil.createClient("jdkClient");
final Request req = Request.of("https://www.hutool.cn/").method(Method.GET);
final Response res = engine.send(req);