From 48e5924837e37551613cc215aa16ea8b7732f2ad Mon Sep 17 00:00:00 2001 From: VihasMakwana <121151420+VihasMakwana@users.noreply.github.com> Date: Fri, 7 Jun 2024 20:04:22 +0530 Subject: [PATCH] Update filebeat/input/filestream/input_test.go Co-authored-by: Tiago Queiroz --- filebeat/input/filestream/input_test.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/filebeat/input/filestream/input_test.go b/filebeat/input/filestream/input_test.go index b267fce2740..3dfe176ac01 100644 --- a/filebeat/input/filestream/input_test.go +++ b/filebeat/input/filestream/input_test.go @@ -117,16 +117,15 @@ paths: } func TestTakeOverTags(t *testing.T) { - testCases := []struct { name string takeOver bool - testFunc func(event beat.Event) + testFunc func(t *testing.T, event beat.Event) }{ { name: "test-take_over-true", takeOver: true, - testFunc: func(event beat.Event) { + testFunc: func(t *testing.T, event beat.Event) { tags, err := event.GetValue("tags") require.NoError(t, err) require.Contains(t, tags, "take_over") @@ -135,7 +134,7 @@ func TestTakeOverTags(t *testing.T) { { name: "test-take_over-false", takeOver: false, - testFunc: func(event beat.Event) { + testFunc: func(t *testing.T, event beat.Event) { _, err := event.GetValue("tags") require.ErrorIs(t, err, mapstr.ErrKeyNotFound) }, @@ -153,7 +152,7 @@ paths: runner := createFilestreamTestRunner(context.Background(), t, testCase.name, cfg, 5, true) events := runner(t) for _, event := range events { - testCase.testFunc(event) + testCase.testFunc(t, event) } }) }