LadyForest commented on code in PR #138:
URL: https://github.com/apache/flink-table-store/pull/138#discussion_r884456680


##########
flink-table-store-connector/src/test/java/org/apache/flink/table/store/connector/TableStoreManagedFactoryTest.java:
##########
@@ -256,9 +284,288 @@ public void testCreateAndCheckTableStore(
         }
     }
 
+    @Test
+    public void testOnCompactTableForNoSnapshot() {
+        RowType partType = RowType.of();
+        MockTableStoreManagedFactory mockTableStoreManagedFactory =
+                new MockTableStoreManagedFactory(partType, 
NON_PARTITIONED_ROW_TYPE);
+        prepare(
+                TABLE + "_" + UUID.randomUUID(),
+                partType,
+                NON_PARTITIONED_ROW_TYPE,
+                NON_PARTITIONED,
+                true);
+        assertThatThrownBy(
+                        () ->
+                                mockTableStoreManagedFactory.onCompactTable(
+                                        context, new 
CatalogPartitionSpec(emptyMap())))
+                .isInstanceOf(IllegalStateException.class)
+                .hasMessageContaining("The specified table to compact does not 
exist any snapshot");
+    }
+
+    @ParameterizedTest
+    @ValueSource(booleans = {true, false})
+    public void testOnCompactTableForNonPartitioned(boolean rescaleBucket) 
throws Exception {
+        RowType partType = RowType.of();
+        runTest(
+                new MockTableStoreManagedFactory(partType, 
NON_PARTITIONED_ROW_TYPE),
+                TABLE + "_" + UUID.randomUUID(),
+                partType,
+                NON_PARTITIONED_ROW_TYPE,
+                NON_PARTITIONED,
+                rescaleBucket);
+    }
+
+    @ParameterizedTest
+    @ValueSource(booleans = {true, false})
+    public void testOnCompactTableForSinglePartitioned(boolean rescaleBucket) 
throws Exception {
+        runTest(
+                new MockTableStoreManagedFactory(
+                        SINGLE_PARTITIONED_PART_TYPE, 
SINGLE_PARTITIONED_ROW_TYPE),
+                TABLE + "_" + UUID.randomUUID(),
+                SINGLE_PARTITIONED_PART_TYPE,
+                SINGLE_PARTITIONED_ROW_TYPE,
+                SINGLE_PARTITIONED,
+                rescaleBucket);
+    }
+
+    @ParameterizedTest
+    @ValueSource(booleans = {true, false})
+    public void testOnCompactTableForMultiPartitioned(boolean rescaleBucket) 
throws Exception {
+        runTest(
+                new MockTableStoreManagedFactory(),
+                TABLE + "_" + UUID.randomUUID(),
+                DEFAULT_PART_TYPE,
+                DEFAULT_ROW_TYPE,
+                MULTI_PARTITIONED,
+                rescaleBucket);
+    }
+
+    @MethodSource("provideManifest")
+    @ParameterizedTest

Review Comment:
   > Can we have a name for each parameter? Very difficult to maintain without 
a name.
   
   I cannot understand well what you mean. Do you suggest not use Junit5 
parameterized test? Method source doc illustrates the usage.
   
![image](https://user-images.githubusercontent.com/55568005/170916432-3a9e59ca-3734-4ddb-aaa4-bf825e06f731.png)
   



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