The general strategy for unit testing the
DataSourceRuntime involves:
Constructing a
DataSourceRuntimewith a mockPipelineComponentRuntimeContextthat contains a mockOutputChannel, a mockErrorChannel, and a mockPipelineComponentContext.Constructing an
IncrementalDataSourceRuntimeif a data source extension determines its own incrementals.Invoking
DataSourceRuntime.runFullAcquisition()and verifying that the correct records are output to the mockOutputChannel.Invoking
IncrementalDataSourceRuntime.runIncrementalAcquisition()and verifying that the correct records are output to the mockOutputChannel. This is necessary if you constructed aIncrementalDataSourceRuntime.Invoking
ErrorChannel.discard()as necessary to discard any records that are invalid or have errors, and verifying that the invalid records are discarded to the mockErrorChannel.

