amogh-jahagirdar commented on code in PR #6223:
URL: https://github.com/apache/iceberg/pull/6223#discussion_r1031954363


##########
aws/src/test/java/org/apache/iceberg/aws/glue/TestGlueCatalog.java:
##########
@@ -144,6 +144,32 @@ public void testDefaultWarehouseLocationDbUri() {
     Assert.assertEquals("s3://bucket2/db/table", location);
   }
 
+  @Test
+  public void testDefaultWarehouseLocationCustomCatalogId() {
+    GlueCatalog catalogWithCustomCatalogId = new GlueCatalog();
+    String catalogId = "myCatalogId";
+    AwsProperties awsProperties = new AwsProperties();
+    awsProperties.setGlueCatalogId(catalogId);
+    catalogWithCustomCatalogId.initialize(
+        CATALOG_NAME,
+        WAREHOUSE_PATH + "/",
+        awsProperties,
+        glue,
+        LockManagers.defaultLockManager(),
+        null,
+        ImmutableMap.of());
+
+    Mockito.doReturn(
+            GetDatabaseResponse.builder()
+                
.database(Database.builder().name("db").locationUri("s3://bucket2/db").build())
+                .build())
+        .when(glue)
+        .getDatabase(Mockito.any(GetDatabaseRequest.class));
+    
catalogWithCustomCatalogId.defaultWarehouseLocation(TableIdentifier.of("db", 
"table"));
+    Mockito.verify(glue)
+        .getDatabase(Mockito.argThat((GetDatabaseRequest req) -> 
req.catalogId() == catalogId));

Review Comment:
   Since catalogId is a string can we do the equality check via .equals?
   
   ```
   Mockito.argThat((GetDatabaseRequest req) -> 
catalogId.equals(req.catalogId()))
   ```



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

Reply via email to