jackye1995 commented on code in PR #7468:
URL: https://github.com/apache/iceberg/pull/7468#discussion_r1181818789


##########
api/src/test/java/org/apache/iceberg/TestPartitionSpecValidation.java:
##########
@@ -158,25 +119,55 @@ public void 
testMultipleDatePartitionsWithDifferentSourceColumns() {
   @Test
   public void testMultipleIdentityPartitions() {
     
PartitionSpec.builderFor(SCHEMA).year("d").identity("id").identity("d").identity("s").build();
-    AssertHelpers.assertThrows(
-        "Should not allow identity(id) and identity(id)",
-        IllegalArgumentException.class,
-        "Cannot use partition name more than once",
-        () -> 
PartitionSpec.builderFor(SCHEMA).identity("id").identity("id").build());
-    AssertHelpers.assertThrows(
-        "Should not allow identity(id) and identity(id, name)",
-        IllegalArgumentException.class,
-        "Cannot add redundant partition",
-        () -> PartitionSpec.builderFor(SCHEMA).identity("id").identity("id", 
"test-id").build());
-    AssertHelpers.assertThrows(
-        "Should not allow identity(id) and identity(id, name)",
-        IllegalArgumentException.class,
-        "Cannot use partition name more than once",
-        () ->
-            PartitionSpec.builderFor(SCHEMA)
-                .identity("id", "test-id")
-                .identity("d", "test-id")
-                .build());
+    Assertions.assertThatThrownBy(
+            () -> 
PartitionSpec.builderFor(SCHEMA).identity("id").identity("id").build())
+        .isInstanceOf(IllegalArgumentException.class)
+        .hasMessageContaining("Cannot use partition name more than once");
+
+    Assertions.assertThatThrownBy(
+            () -> 
PartitionSpec.builderFor(SCHEMA).identity("id").identity("id", 
"test-id").build())
+        .isInstanceOf(IllegalArgumentException.class)
+        .hasMessageContaining("Cannot add redundant partition");
+
+    Assertions.assertThatThrownBy(
+            () ->
+                PartitionSpec.builderFor(SCHEMA)
+                    .identity("id", "test-id")
+                    .identity("d", "test-id")
+                    .build())
+        .isInstanceOf(IllegalArgumentException.class)
+        .hasMessageContaining("Cannot use partition name more than once");
+  }
+
+  @Test
+  public void testMultipleDatePartitions() {

Review Comment:
   can we avoid moving tests around? It changes the git diff order



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