The MockRestServiceServer has a handy feature that allows one to configure content buffering, which configures a BufferingClientHttpRequestFactory around the MockClientHttpRequestFactory. I often have code like interceptors that relies on this buffering to be present.

In a Spring Boot test, you typically use a MockServerRestTemplateCustomizer to configure the mock server for your RestTemplate using its customize method. That method creates the mock server for you, but currently does not allow you to enable the buffering.

A simple property on the MockServerRestTemplateCustomizer read in the customize method would suffice to make this work, I think. Would you consider this enhancement request?

Comment From: wilkinsona

Thanks for the suggestion, @jkuipers. This looks like a good idea to me. The proposed property would fit nicely alongside the existing setDetectRootUri(boolean) method.

Comment From: scottfrederick

Closing in favor of #34833