nodece opened a new pull request, #25124: URL: https://github.com/apache/pulsar/pull/25124
### Motivation This pull request improves the handling and testing of asynchronous GET requests in the Pulsar admin client. The main changes ensure that both HTTP 200 (OK) and 204 (No Content) responses are treated as successful, and introduce comprehensive tests to verify correct behavior for various HTTP response scenarios. ### Modifications **Enhancements to async GET request handling:** * Modified `BaseResource.java` so that both HTTP 200 (OK) and 204 (No Content) responses are accepted as successful. For 204 responses, the future is completed with `null` since there is no response body to process. **Testing improvements:** * Added a new test class `AsyncGetRequestTest.java` to thoroughly test the async GET request logic. The tests cover successful responses with and without a body (200 and 204), as well as error responses like 404 and 500, and 200 with an empty body. **Testability and code maintenance:** * Exposed the `root` WebTarget in `PulsarAdminImpl` via a new `@VisibleForTesting` method to facilitate direct testing of request paths. * Added the necessary import for `@VisibleForTesting` to `PulsarAdminImpl.java`. ### Documentation <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> - [ ] `doc` <!-- Your PR contains doc changes. --> - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later --> - [x] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
