nastra commented on code in PR #12194: URL: https://github.com/apache/iceberg/pull/12194#discussion_r2262682780
########## core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java: ########## @@ -2698,6 +2706,133 @@ public void testTableExistsFallbackToGETRequestWithLegacyServer() { verifyTableExistsFallbackToGETRequest(ConfigResponse.builder().build()); } + @Test + public void testETagCreateTableAndLoadTable() { + Map<String, String> respHeaders = Maps.newConcurrentMap(); + + RESTCatalog catalog = setUpETagTest(respHeaders); + + catalog.createTable(TABLE, SCHEMA); + + assertThat(respHeaders).containsKey(HttpHeaders.ETAG); + String eTag = respHeaders.get(HttpHeaders.ETAG); + respHeaders.clear(); + + catalog.loadTable(TABLE); + + assertThat(respHeaders).containsKey(HttpHeaders.ETAG); + assertThat(eTag).isEqualTo(respHeaders.get(HttpHeaders.ETAG)); + respHeaders.clear(); Review Comment: no need to clear this here ########## core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java: ########## @@ -2698,6 +2706,133 @@ public void testTableExistsFallbackToGETRequestWithLegacyServer() { verifyTableExistsFallbackToGETRequest(ConfigResponse.builder().build()); } + @Test + public void testETagCreateTableAndLoadTable() { + Map<String, String> respHeaders = Maps.newConcurrentMap(); + + RESTCatalog catalog = setUpETagTest(respHeaders); + + catalog.createTable(TABLE, SCHEMA); + + assertThat(respHeaders).containsKey(HttpHeaders.ETAG); + String eTag = respHeaders.get(HttpHeaders.ETAG); + respHeaders.clear(); + + catalog.loadTable(TABLE); + + assertThat(respHeaders).containsKey(HttpHeaders.ETAG); + assertThat(eTag).isEqualTo(respHeaders.get(HttpHeaders.ETAG)); Review Comment: can be simplified to `assertThat(respHeaders).containsEntry(HttpHeaders.ETAG, eTag)` -- 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