adutra commented on code in PR #12595: URL: https://github.com/apache/iceberg/pull/12595#discussion_r2019104523
########## core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java: ########## @@ -332,6 +336,41 @@ public void testInitializeWithBadArguments() throws IOException { restCat.close(); } + @Test + public void testDefaultHeadersPropagated() { + Map<String, String> catalogHeaders = + ImmutableMap.of("Authorization", "Bearer client-credentials-token:sub=catalog"); + + Map<String, String> properties = + ImmutableMap.of( + "test-header", "test-value", CatalogProperties.URI, httpServer.getURI().toString()); + Map<String, String> expectedHeaders = ImmutableMap.of("test-header", "test-value"); + HTTPClient client = + Mockito.spy( + HTTPClient.builder(properties) + .withHeaders(RESTUtil.merge(RESTUtil.configHeaders(properties), catalogHeaders)) + .uri(properties.get(CatalogProperties.URI)) + .build()); + RESTCatalog catalog = + new RESTCatalog(SessionCatalog.SessionContext.createEmpty(), (config) -> client); Review Comment: Try this: ```java Mockito.doNothing().when(client).close(); ``` -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org