You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I Upgraded Spring Boot (was 3.1.9, became 3.2.2)
At the same time, the spring-web version increased (it was 6.0.17, became 6.1.3)
After that, the test works with errors
This test calls method "customize":
where
MdcService - we have written an interface "MdcService" that defines the filling of MdcContext
Test throws an error (part of the stacktrace is given below):
If you replace with restClient in the restTemplate test and make the call as to restClient, then the test will end with the same errors
(val restClient = RestClient.builder(restTemplate).build())
I found an explanation for these errors: #1693
This is because HttpComponentsClientHttpRequest has been reworked in Spring Framework 6.1.
There is also a link ( #1701) and says:
Use writeTo() to buffer HttpEntity in httpclient5
Use HttpEntity.writeTo() instead of relying on EntityUtils.toByteArray() to copy the OutputStream of the HttpEntity.
Thus, for test is necessary to replace EntityUtils.toByteArray() with HttpEntity.writeTo()
But how to do this if EntityUtils.toByteArray () is deep in stacktrace
How to fix the test?
Expected Behavior
Test passes without errors
Your Environment
Version used:
Logbook: 3.5.0
Spring Boot: 3.2.2
spring-web: 6.1.3
The text was updated successfully, but these errors were encountered:
Description
I Upgraded Spring Boot (was 3.1.9, became 3.2.2)
At the same time, the spring-web version increased (it was 6.0.17, became 6.1.3)
After that, the test works with errors
This test calls method "customize":
where
MdcService - we have written an interface "MdcService" that defines the filling of MdcContext
Test throws an error (part of the stacktrace is given below):
If you replace with restClient in the restTemplate test and make the call as to restClient, then the test will end with the same errors
(val restClient = RestClient.builder(restTemplate).build())
I found an explanation for these errors: #1693
This is because HttpComponentsClientHttpRequest has been reworked in Spring Framework 6.1.
There is also a link ( #1701) and says:
Use writeTo() to buffer HttpEntity in httpclient5
Use HttpEntity.writeTo() instead of relying on EntityUtils.toByteArray() to copy the OutputStream of the HttpEntity.
Thus, for test is necessary to replace EntityUtils.toByteArray() with HttpEntity.writeTo()
But how to do this if EntityUtils.toByteArray () is deep in stacktrace
How to fix the test?
Expected Behavior
Test passes without errors
Your Environment
The text was updated successfully, but these errors were encountered: