nastra commented on code in PR #14808:
URL: https://github.com/apache/iceberg/pull/14808#discussion_r2614435213
##########
core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java:
##########
@@ -3311,6 +3312,111 @@ public void
testClientDoesNotSendIdempotencyWhenServerNotAdvertising() {
local.dropTable(ident);
}
+ @Test
+ public void testClientWithLegacyNamespaceSeparator() {
+ RESTCatalogAdapter adapter = Mockito.spy(new
RESTCatalogAdapter(backendCatalog));
+
+ // Simulate that the server doesn't send the namespace separator in the
overrides
+ Mockito.doAnswer(
+ invocation -> {
+ ConfigResponse configResponse = (ConfigResponse)
invocation.callRealMethod();
+
+ Map<String, String> overridesWithoutNamespaceSeparator =
configResponse.overrides();
+
overridesWithoutNamespaceSeparator.remove(RESTCatalogProperties.NAMESPACE_SEPARATOR);
+
+ return ConfigResponse.builder()
+ .withDefaults(configResponse.defaults())
+ .withOverrides(overridesWithoutNamespaceSeparator)
+ .withEndpoints(configResponse.endpoints())
+
.withIdempotencyKeyLifetime(configResponse.idempotencyKeyLifetime())
+ .build();
+ })
+ .when(adapter)
+ .execute(
+ reqMatcher(HTTPMethod.GET, ResourcePaths.config()),
+ eq(ConfigResponse.class),
+ any(),
+ any());
+
+ RESTCatalog catalog = catalog(adapter);
+
+ ResourcePaths pathsWithLegacySeparators =
ResourcePaths.forCatalogProperties(ImmutableMap.of());
Review Comment:
```suggestion
ResourcePaths pathsWithLegacySeparator =
ResourcePaths.forCatalogProperties(ImmutableMap.of());
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]