tomtongue commented on code in PR #10086:
URL: https://github.com/apache/iceberg/pull/10086#discussion_r1555519947


##########
aws/src/integration/java/org/apache/iceberg/aws/glue/TestGlueCatalogTable.java:
##########
@@ -84,43 +84,35 @@ public void testCreateTable() {
     // verify table exists in Glue
     GetTableResponse response =
         
glue.getTable(GetTableRequest.builder().databaseName(namespace).name(tableName).build());
-    Assert.assertEquals(namespace, response.table().databaseName());
-    Assert.assertEquals(tableName, response.table().name());
-    Assert.assertEquals(
-        
BaseMetastoreTableOperations.ICEBERG_TABLE_TYPE_VALUE.toUpperCase(Locale.ENGLISH),
-        
response.table().parameters().get(BaseMetastoreTableOperations.TABLE_TYPE_PROP));
-    Assert.assertTrue(
-        response
-            .table()
-            .parameters()
-            .containsKey(BaseMetastoreTableOperations.METADATA_LOCATION_PROP));
-    Assert.assertEquals(
-        schema.columns().size(), 
response.table().storageDescriptor().columns().size());
-    Assert.assertEquals(partitionSpec.fields().size(), 
response.table().partitionKeys().size());
-    Assert.assertEquals(
-        "additionalLocations should match",
-        
tableLocationProperties.values().stream().sorted().collect(Collectors.toList()),
-        response.table().storageDescriptor().additionalLocations().stream()
-            .sorted()
-            .collect(Collectors.toList()));
+    assertThat(response.table().databaseName()).isEqualTo(namespace);
+    assertThat(response.table().name()).isEqualTo(tableName);
+    assertThat(response.table().parameters())
+        .containsEntry(
+            BaseMetastoreTableOperations.TABLE_TYPE_PROP,
+            
BaseMetastoreTableOperations.ICEBERG_TABLE_TYPE_VALUE.toUpperCase(Locale.ENGLISH))
+        .containsKey(BaseMetastoreTableOperations.METADATA_LOCATION_PROP);
+    
assertThat(response.table().storageDescriptor().columns()).hasSameSizeAs(schema.columns());
+    
assertThat(response.table().partitionKeys()).hasSameSizeAs(partitionSpec.fields());
+    assertThat(response.table().storageDescriptor().additionalLocations())

Review Comment:
   thanks for the suggestion. I think the suggestion drops the sorting check. 
So this uses `isEqualTo` and it's not flaky test.



##########
aws/src/integration/java/org/apache/iceberg/aws/glue/TestGlueCatalogTable.java:
##########
@@ -84,43 +84,35 @@ public void testCreateTable() {
     // verify table exists in Glue
     GetTableResponse response =
         
glue.getTable(GetTableRequest.builder().databaseName(namespace).name(tableName).build());
-    Assert.assertEquals(namespace, response.table().databaseName());
-    Assert.assertEquals(tableName, response.table().name());
-    Assert.assertEquals(
-        
BaseMetastoreTableOperations.ICEBERG_TABLE_TYPE_VALUE.toUpperCase(Locale.ENGLISH),
-        
response.table().parameters().get(BaseMetastoreTableOperations.TABLE_TYPE_PROP));
-    Assert.assertTrue(
-        response
-            .table()
-            .parameters()
-            .containsKey(BaseMetastoreTableOperations.METADATA_LOCATION_PROP));
-    Assert.assertEquals(
-        schema.columns().size(), 
response.table().storageDescriptor().columns().size());
-    Assert.assertEquals(partitionSpec.fields().size(), 
response.table().partitionKeys().size());
-    Assert.assertEquals(
-        "additionalLocations should match",
-        
tableLocationProperties.values().stream().sorted().collect(Collectors.toList()),
-        response.table().storageDescriptor().additionalLocations().stream()
-            .sorted()
-            .collect(Collectors.toList()));
+    assertThat(response.table().databaseName()).isEqualTo(namespace);
+    assertThat(response.table().name()).isEqualTo(tableName);
+    assertThat(response.table().parameters())
+        .containsEntry(
+            BaseMetastoreTableOperations.TABLE_TYPE_PROP,
+            
BaseMetastoreTableOperations.ICEBERG_TABLE_TYPE_VALUE.toUpperCase(Locale.ENGLISH))
+        .containsKey(BaseMetastoreTableOperations.METADATA_LOCATION_PROP);
+    
assertThat(response.table().storageDescriptor().columns()).hasSameSizeAs(schema.columns());
+    
assertThat(response.table().partitionKeys()).hasSameSizeAs(partitionSpec.fields());
+    assertThat(response.table().storageDescriptor().additionalLocations())

Review Comment:
   thanks for the suggestion. I think the suggestion drops the sorting check. 
So this uses `isEqualTo` and it's not flaky.



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