gaborkaszab commented on code in PR #14808:
URL: https://github.com/apache/iceberg/pull/14808#discussion_r2607343742


##########
core/src/test/java/org/apache/iceberg/rest/TestRESTCatalog.java:
##########
@@ -3311,6 +3312,59 @@ public void 
testClientDoesNotSendIdempotencyWhenServerNotAdvertising() {
     local.dropTable(ident);
   }
 
+  @Test
+  public void testClientWithDefaultNamespaceSeparator() {
+    RESTCatalogAdapter adapter = Mockito.spy(new 
RESTCatalogAdapter(backendCatalog));
+
+    Mockito.doAnswer(
+            invocation -> {
+              ConfigResponse configResponse = (ConfigResponse) 
invocation.callRealMethod();
+
+              Map<String, String> overridesWithoutNamespaceSeparator = 
configResponse.overrides();
+              
overridesWithoutNamespaceSeparator.remove(RESTCatalogProperties.NAMESPACE_SEPARATOR);

Review Comment:
   I don't think I get your first sentence. I don't override the endpoint on 
the adaptor here, so it sends the preferred new separator in the overrides. I 
kind of put a wrapper around the endpoint with Mockito.doAnswer to remove the 
separator from the overrides. This is how I can test a client that uses the 
default separator and not the one sent by the adapter/server. An alternative 
setup would be to create an adapter that in fact overrides the getConfig 
endpoint like in testConfigRoute() but I preferred the doAnswer approach.
   
   Note, currently almost all the other tests are running with the new 
separator because the adapter sends the override, unless the test explicitly 
overrides the getConfig endpoint. Maybe we misunderstood each other but this 
test what I intended: a client that uses the default separator (not overriden 
by server overrides), and then checking if that separator is used when calling 
endpoints. This is something that has no test coverage now.
   
   Do you mean to test when the client configurations have some separator 
(could be the default one) and the server/adapter sends overrides and we check 
that the client applied the overrides and uses the separators desired by the 
server?
   
   (sorry for the long answer :) )



-- 
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]

Reply via email to