C0urante edited a comment on pull request #11844:
URL: https://github.com/apache/kafka/pull/11844#issuecomment-1067286831


   @Corlobin thanks for identifying this issue and filing a fix!
   
   This should probably come with a unit test. I see that you mentioned that 
the `RestClient` class doesn't have any tests--I think now would be a good time 
to add one.
   
   One strategy could be to add a new package-private (i.e., not `public`, 
`protected`, or `private`) method to the `RestClient` class that accepts an 
`HttpClient` instance as an argument. This method could all of the work that 
the existing `httpRequest` method already does except construct its own 
`HttpClient`, which would allow us to create a mock `HttpClient` to use with 
unit testing. The existing `httpRequest` method could then be refactored to do 
nothing except create a new `HttpClient` and then delegate to the new method, 
passing in that client as an additional argument.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to