The general strategy for unit testing the
DataSourceRuntime
involves:
Constructing a
DataSourceRuntime
with a mockPipelineComponentRuntimeContext
that contains a mockOutputChannel
, a mockErrorChannel
, and a mockPipelineComponentContext
.Constructing an
IncrementalDataSourceRuntime
if 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
.