@@ -316,11 +316,9 @@ func TestLoadAcquisitionFromFiles(t *testing.T) {
316316
317317type MockCat struct {
318318 configuration.DataSourceCommonCfg `yaml:",inline"`
319- logger * log.Entry
320319}
321320
322- func (f * MockCat ) Configure (_ []byte , logger * log.Entry , _ metrics.AcquisitionMetricsLevel ) error {
323- f .logger = logger
321+ func (f * MockCat ) Configure (_ []byte , _ * log.Entry , _ metrics.AcquisitionMetricsLevel ) error {
324322 if f .Mode == "" {
325323 f .Mode = configuration .CAT_MODE
326324 }
@@ -353,11 +351,9 @@ func (*MockCat) GetUuid() string { return "" }
353351
354352type MockTail struct {
355353 configuration.DataSourceCommonCfg `yaml:",inline"`
356- logger * log.Entry
357354}
358355
359- func (f * MockTail ) Configure (_ []byte , logger * log.Entry , _ metrics.AcquisitionMetricsLevel ) error {
360- f .logger = logger
356+ func (f * MockTail ) Configure (_ []byte , _ * log.Entry , _ metrics.AcquisitionMetricsLevel ) error {
361357 if f .Mode == "" {
362358 f .Mode = configuration .TAIL_MODE
363359 }
@@ -574,9 +570,12 @@ func (*TailModeNoTailer) CanRun() error { return nil }
574570func TestStartAcquisition_MissingTailer (t * testing.T ) {
575571 ctx := t .Context ()
576572 out := make (chan types.Event )
577- var tb tomb.Tomb
578573 errCh := make (chan error , 1 )
574+
575+ var tb tomb.Tomb
576+
579577 go func () { errCh <- StartAcquisition (ctx , []DataSource {& TailModeNoTailer {}}, out , & tb ) }()
578+
580579 require .ErrorContains (t , <- errCh , "tail_no_tailer: tail mode is set but StreamingAcquisition is not supported" )
581580}
582581
@@ -594,8 +593,11 @@ func (*CatModeNoFetcher) CanRun() error { return nil }
594593func TestStartAcquisition_MissingFetcher (t * testing.T ) {
595594 ctx := t .Context ()
596595 out := make (chan types.Event )
597- var tb tomb.Tomb
598596 errCh := make (chan error , 1 )
597+
598+ var tb tomb.Tomb
599+
599600 go func () { errCh <- StartAcquisition (ctx , []DataSource {& CatModeNoFetcher {}}, out , & tb ) }()
601+
600602 require .ErrorContains (t , <- errCh , "cat_no_fetcher: cat mode is set but OneShotAcquisition is not supported" )
601603}
0 commit comments