snuyanzin commented on code in PR #29424:
URL: https://github.com/apache/flink/pull/29424#discussion_r4224660547


##########
flink-table/flink-table-runtime/src/test/java/org/apache/flink/table/runtime/operators/window/tvf/unslicing/WindowedUnsliceAssignerTest.java:
##########
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.table.runtime.operators.window.tvf.unslicing;
+
+import org.apache.flink.table.data.RowData;
+import org.apache.flink.table.data.TimestampData;
+import org.apache.flink.table.data.binary.BinaryRowData;
+import org.apache.flink.table.data.writer.BinaryRowWriter;
+import org.apache.flink.table.runtime.operators.window.TimeWindow;
+
+import org.junit.jupiter.api.Test;
+
+import java.time.Duration;
+import java.time.ZoneId;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+/** Tests for {@link UnsliceAssigners.WindowedUnsliceAssigner}. */
+class WindowedUnsliceAssignerTest {
+
+    private final UnsliceAssigners.WindowedUnsliceAssigner assigner =
+            UnsliceAssigners.windowed(
+                    0, 1, UnsliceAssigners.session(2, ZoneId.of("UTC"), 
Duration.ofSeconds(5)));
+
+    @Test
+    void testAssignWindows() throws Exception {
+        assertThat(assigner.assignWindows(row(1000L, 6000L), 0L))
+                .containsExactly(new TimeWindow(1000L, 6000L));
+    }
+
+    @Test
+    void testNullWindowStart() {
+        assertThatThrownBy(() -> assigner.assignWindows(row(null, 6000L), 0L))
+                .isInstanceOf(IllegalStateException.class)
+                .hasMessage(
+                        "Window start or window end of the input row is null. "
+                                + "Both should be set by the upstream window 
operator. "
+                                + "This is a bug. Please file an issue.");
+    }
+
+    @Test
+    void testNullWindowEnd() {
+        assertThatThrownBy(() -> assigner.assignWindows(row(1000L, null), 0L))

Review Comment:
   we don't need to accumulate low level tests which are always subject to 
refactor and nobody can explain why we need it.
   Better to focus on SQL tests



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

Reply via email to