You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "jackye1995 (via GitHub)" <gi...@apache.org> on 2023/05/01 19:16:24 UTC

[GitHub] [iceberg] jackye1995 commented on a diff in pull request #7468: Deprecate AssertHelpers - iceberg-orc, mr and api modules

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


##########
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:
   missing test cases?



-- 
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-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org