mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-21 05:09:13 +00:00
Merge branch '7.0.x'
This commit is contained in:
+23
@@ -19,6 +19,7 @@ package org.springframework.http.client;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.Duration;
|
||||
|
||||
import org.jspecify.annotations.Nullable;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
@@ -109,6 +110,28 @@ class JdkClientHttpRequestFactoryTests extends AbstractHttpRequestFactoryTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void readTimeoutZeroShouldNotThrowException() throws Exception {
|
||||
((JdkClientHttpRequestFactory) factory).setReadTimeout(0);
|
||||
URI uri = URI.create(this.baseUrl + "/methods/get");
|
||||
ClientHttpRequest request =
|
||||
new BufferingClientHttpRequestFactory(this.factory).createRequest(uri, HttpMethod.GET);
|
||||
try (ClientHttpResponse response = request.execute()) {
|
||||
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void readTimeoutDurationZeroShouldNotThrowException() throws Exception {
|
||||
((JdkClientHttpRequestFactory) factory).setReadTimeout(Duration.ZERO);
|
||||
URI uri = URI.create(this.baseUrl + "/methods/get");
|
||||
ClientHttpRequest request =
|
||||
new BufferingClientHttpRequestFactory(this.factory).createRequest(uri, HttpMethod.GET);
|
||||
try (ClientHttpResponse response = request.execute()) {
|
||||
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void compressionDisabled() throws IOException {
|
||||
URI uri = URI.create(baseUrl + "/compress/");
|
||||
|
||||
Reference in New Issue
Block a user