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


##########
api/src/test/java/org/apache/iceberg/TestPartitionSpecValidation.java:
##########
@@ -36,95 +37,55 @@ public class TestPartitionSpecValidation {
 
   @Test
   public void testMultipleTimestampPartitions() {
-    AssertHelpers.assertThrows(
-        "Should not allow year(ts) and year(ts)",
-        IllegalArgumentException.class,
-        "Cannot use partition name more than once",
-        () -> PartitionSpec.builderFor(SCHEMA).year("ts").year("ts").build());
-    AssertHelpers.assertThrows(
-        "Should not allow year(ts) and month(ts)",
-        IllegalArgumentException.class,
-        "Cannot add redundant partition",
-        () -> PartitionSpec.builderFor(SCHEMA).year("ts").month("ts").build());
-    AssertHelpers.assertThrows(
-        "Should not allow year(ts) and day(ts)",
-        IllegalArgumentException.class,
-        "Cannot add redundant partition",
-        () -> PartitionSpec.builderFor(SCHEMA).year("ts").day("ts").build());
-    AssertHelpers.assertThrows(
-        "Should not allow year(ts) and hour(ts)",
-        IllegalArgumentException.class,
-        "Cannot add redundant partition",
-        () -> PartitionSpec.builderFor(SCHEMA).year("ts").hour("ts").build());
-
-    AssertHelpers.assertThrows(
-        "Should not allow month(ts) and month(ts)",
-        IllegalArgumentException.class,
-        "Cannot use partition name more than once",
-        () -> 
PartitionSpec.builderFor(SCHEMA).month("ts").month("ts").build());
-    AssertHelpers.assertThrows(
-        "Should not allow month(ts) and day(ts)",
-        IllegalArgumentException.class,
-        "Cannot add redundant partition",
-        () -> PartitionSpec.builderFor(SCHEMA).month("ts").day("ts").build());
-    AssertHelpers.assertThrows(
-        "Should not allow month(ts) and hour(ts)",
-        IllegalArgumentException.class,
-        "Cannot add redundant partition",
-        () -> PartitionSpec.builderFor(SCHEMA).month("ts").hour("ts").build());
-
-    AssertHelpers.assertThrows(
-        "Should not allow day(ts) and day(ts)",
-        IllegalArgumentException.class,
-        "Cannot use partition name more than once",
-        () -> PartitionSpec.builderFor(SCHEMA).day("ts").day("ts").build());
-    AssertHelpers.assertThrows(
-        "Should not allow day(ts) and hour(ts)",
-        IllegalArgumentException.class,
-        "Cannot add redundant partition",
-        () -> PartitionSpec.builderFor(SCHEMA).day("ts").hour("ts").build());
-
-    AssertHelpers.assertThrows(
-        "Should not allow hour(ts) and hour(ts)",
-        IllegalArgumentException.class,
-        "Cannot use partition name more than once",
-        () -> PartitionSpec.builderFor(SCHEMA).hour("ts").hour("ts").build());
-  }
+    Assertions.assertThatThrownBy(

Review Comment:
   oh I see, nvm, the other ones are shown below.



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