nastra commented on code in PR #9008:
URL: https://github.com/apache/iceberg/pull/9008#discussion_r1629238344


##########
api/src/test/java/org/apache/iceberg/transforms/TestTimestamps.java:
##########
@@ -241,4 +243,54 @@ public void testTimestampsReturnType() {
     Type hourResultType = hour.getResultType(type);
     assertThat(hourResultType).isEqualTo(Types.IntegerType.get());
   }
+
+  @Test
+  public void apply_bad_source_type() {

Review Comment:
   ```suggestion
     public void applyBadSourceType() {
   ```



##########
api/src/test/java/org/apache/iceberg/transforms/TestTimestamps.java:
##########
@@ -241,4 +243,54 @@ public void testTimestampsReturnType() {
     Type hourResultType = hour.getResultType(type);
     assertThat(hourResultType).isEqualTo(Types.IntegerType.get());
   }
+
+  @Test
+  public void apply_bad_source_type() {
+    Timestamps badSourceType =
+        new Timestamps(ChronoUnit.CENTURIES, Timestamps.ResultTypeUnit.YEARS, 
"year");
+    assertThatThrownBy(() -> badSourceType.apply(11L))
+        .isInstanceOf(UnsupportedOperationException.class)
+        .hasMessageMatching("Unsupported source type unit: Centuries");
+  }
+
+  @Test
+  public void apply_bad_result_type() {

Review Comment:
   ```suggestion
     public void applyBadResultType() {
   ```



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