Apache HttpClient has been superseded by Apache HttpClient 5. The spring-boot-buildpack-platform module still uses HttpClient APIs, and should be migrated to the HttpClient 5 APIs.

Comment From: anugrahsinghal

Hey @scottfrederick

I have raised PR #33649 for this.

If you could, please take a look, and if the changes are sufficient, I can make the same for #33534.


The PR #33649 uses mockito feature to mock final class ClosableHttpResponse but the same can be achieved without mocking the final Class, but needs more changes to the source itself.

I have tried those changes too, and you can find them here anugrahsinghal/spring-boot/gh-33533-no-final-mock if you would like to take a look.

the changes are needed in HttpClientTransport - to use HttpClient interface as input to the constructor, instead of CloseableHttpClient which is an abstract class - use ClassicHttpResponse in the HttpClientResponse class and in tests

Comment From: scottfrederick

@anugrahsinghal I already have the changes for this and for #33534 completed, which is why I marked the issue as assigned to me. We want to wait until Spring Boot 3.1 to make these changes, and we haven't created the branches necessary to start work on 3.1 yet.

Comment From: anugrahsinghal

apologies @scottfrederick I did not pay attention to the assignee.

Thanks for letting me know :)