Source:
public void testTableSource() { final DataType producedDataType = SOURCE_SCHEMA.toPhysicalRowDataType(); final Map<KafkaTopicPartition, Long> specificOffsets = new HashMap<>(); specificOffsets.put(new KafkaTopicPartition(TOPIC, PARTITION_0), OFFSET_0); specificOffsets.put(new KafkaTopicPartition(TOPIC, PARTITION_1), OFFSET_1); DecodingFormat<DeserializationSchema<RowData>> decodingFormat = new TestFormatFactory.DecodingFormatMock(",", true); ObjectIdentifier objectIdentifier = ObjectIdentifier.of( "default", "default", "scanTable"); CatalogTable catalogTable = createKafkaSourceCatalogTable(); final DynamicTableSource actualSource = FactoryUtil.createTableSource(null, objectIdentifier, catalogTable, new Configuration(), Thread.currentThread().getContextClassLoader()); KAFKA_SOURCE_PROPERTIES.setProperty("flink.partition-discovery.interval-millis", "1000"); final KafkaDynamicSourceBase expectedKafkaSource = getExpectedScanSource( producedDataType, Collections.singletonList(TOPIC), null, KAFKA_SOURCE_PROPERTIES, decodingFormat, StartupMode.SPECIFIC_OFFSETS, specificOffsets, 0); final KafkaDynamicSourceBase actualKafkaSource = (KafkaDynamicSourceBase) actualSource; assertEquals(actualKafkaSource, expectedKafkaSource); ScanTableSource.ScanRuntimeProvider provider = actualKafkaSource.getScanRuntimeProvider(ScanRuntimeProviderContext.INSTANCE); assertThat(provider, instanceOf(SourceFunctionProvider.class)); final SourceFunctionProvider sourceFunctionProvider = (SourceFunctionProvider) provider; final SourceFunction<RowData> sourceFunction = sourceFunctionProvider.createSourceFunction(); assertThat(sourceFunction, instanceOf(getExpectedConsumerClass())); assertTrue(((FlinkKafkaConsumerBase) sourceFunction).getEnableCommitOnCheckpoints()); }

Target:
public void testTableSource() { final DataType producedDataType = SOURCE_SCHEMA.toPhysicalRowDataType(); final Map<KafkaTopicPartition, Long> specificOffsets = new HashMap<>(); specificOffsets.put(new KafkaTopicPartition(TOPIC, PARTITION_0), OFFSET_0); specificOffsets.put(new KafkaTopicPartition(TOPIC, PARTITION_1), OFFSET_1); DecodingFormat<DeserializationSchema<RowData>> decodingFormat = new TestFormatFactory.DecodingFormatMock(",", true); ObjectIdentifier objectIdentifier = ObjectIdentifier.of( "default", "default", "scanTable"); CatalogTable catalogTable = createKafkaSourceCatalogTable(); final DynamicTableSource actualSource = FactoryUtil.createTableSource(null, objectIdentifier, catalogTable, new Configuration(), Thread.currentThread().getContextClassLoader()); final KafkaDynamicSourceBase expectedKafkaSource = getExpectedScanSource( producedDataType, Collections.singletonList(TOPIC), null, KAFKA_SOURCE_PROPERTIES, decodingFormat, StartupMode.SPECIFIC_OFFSETS, specificOffsets, 0); final KafkaDynamicSourceBase actualKafkaSource = (KafkaDynamicSourceBase) actualSource; assertEquals(actualKafkaSource, expectedKafkaSource); ScanTableSource.ScanRuntimeProvider provider = actualKafkaSource.getScanRuntimeProvider(ScanRuntimeProviderContext.INSTANCE); assertThat(provider, instanceOf(SourceFunctionProvider.class)); final SourceFunctionProvider sourceFunctionProvider = (SourceFunctionProvider) provider; final SourceFunction<RowData> sourceFunction = sourceFunctionProvider.createSourceFunction(); assertThat(sourceFunction, instanceOf(getExpectedConsumerClass())); assertTrue(((FlinkKafkaConsumerBase) sourceFunction).getEnableCommitOnCheckpoints()); }