mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Use HttpMessageConverters in client and server config
This commit uses the new `HttpMessageConverters` class for the HTTP client (`RestTemplate` and `RestClient`) and HTTP server support. This effectively removes the duplication of classpath detection for message converters in multiple places: clients, server and the multipart converter itself. Instead of creating multiple instances of the same converters, this allows applications to share converter instances as much as possible for better memory efficiency. As a result, this change also deprecates configuration methods in the MVC support that are superseded by the new methods introduced for `HttpMessageConverters` support. Closes gh-33894
This commit is contained in:
+1
@@ -268,6 +268,7 @@ public class RouterFunctionMockMvcBuilder extends AbstractMockMvcBuilder<RouterF
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("removal")
|
||||
protected void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
|
||||
converters.addAll(messageConverters);
|
||||
}
|
||||
|
||||
+1
@@ -470,6 +470,7 @@ public class StandaloneMockMvcBuilder extends AbstractMockMvcBuilder<StandaloneM
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("removal")
|
||||
protected void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
|
||||
converters.addAll(messageConverters);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user