Browse Source

Polishing

pull/34242/head
rstoyanchev 1 year ago
parent
commit
39bb751546
  1. 1
      spring-web/src/main/java/org/springframework/http/client/BufferingClientHttpRequestFactory.java
  2. 4
      spring-web/src/main/java/org/springframework/web/client/RestClient.java
  3. 6
      spring-web/src/test/java/org/springframework/web/client/RestClientIntegrationTests.java

1
spring-web/src/main/java/org/springframework/http/client/BufferingClientHttpRequestFactory.java

@ -54,6 +54,7 @@ public class BufferingClientHttpRequestFactory extends AbstractClientHttpRequest @@ -54,6 +54,7 @@ public class BufferingClientHttpRequestFactory extends AbstractClientHttpRequest
/**
* Constructor variant with an additional predicate to decide whether to
* buffer the response.
* @since 7.0
*/
public BufferingClientHttpRequestFactory(
ClientHttpRequestFactory requestFactory,

4
spring-web/src/main/java/org/springframework/web/client/RestClient.java

@ -386,8 +386,8 @@ public interface RestClient { @@ -386,8 +386,8 @@ public interface RestClient {
Builder requestInterceptors(Consumer<List<ClientHttpRequestInterceptor>> interceptorsConsumer);
/**
* Enable buffering of request and response content making it possible to
* read the request and the response body multiple times.
* Enable buffering of request and response, aggregating all content before
* it is sent, and making it possible to read the response body repeatedly.
* @param predicate to determine whether to buffer for the given request
* @return this builder
* @since 7.0

6
spring-web/src/test/java/org/springframework/web/client/RestClientIntegrationTests.java

@ -834,9 +834,8 @@ class RestClientIntegrationTests { @@ -834,9 +834,8 @@ class RestClientIntegrationTests {
.retrieve()
.body(String.class);
assertThat(result).isEqualTo("Hello Spring!");
expectRequestCount(1);
assertThat(result).isEqualTo("Hello Spring!");
}
@ParameterizedRestClientTest
@ -860,9 +859,8 @@ class RestClientIntegrationTests { @@ -860,9 +859,8 @@ class RestClientIntegrationTests {
return new String(bytes, UTF_8);
});
assertThat(result).isEqualTo("Hello Spring!");
expectRequestCount(1);
assertThat(result).isEqualTo("Hello Spring!");
}
@ParameterizedRestClientTest

Loading…
Cancel
Save