Skip to content

Commit

Permalink
Update filebeat/input/filestream/input_test.go
Browse files Browse the repository at this point in the history
Co-authored-by: Tiago Queiroz <[email protected]>
  • Loading branch information
VihasMakwana and belimawr authored Jun 7, 2024
1 parent 5b6d5cc commit 48e5924
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions filebeat/input/filestream/input_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)
},
Expand All @@ -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)
}
})
}
Expand Down

0 comments on commit 48e5924

Please sign in to comment.