JingsongLi commented on code in PR #138:
URL: https://github.com/apache/flink-table-store/pull/138#discussion_r885233558
##########
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:
[Is it possible to not use `MethodSource` in this case, the name generated
by the test is difficult to be
maintained.](https://stackoverflow.com/questions/57892989/generating-display-names-for-parameterizedtest-in-junit-5)
--
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]