Skip to content

Commit

Permalink
fixes for linter
Browse files Browse the repository at this point in the history
  • Loading branch information
leehinman committed Oct 17, 2024
1 parent 3e6113d commit bcbdefa
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions libbeat/outputs/kafka/kafka_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,10 @@ func TestKafkaPublish(t *testing.T) {

cfg := makeConfig(t, defaultConfig)
if test.config != nil {
cfg.Merge(makeConfig(t, test.config))
err := cfg.Merge(makeConfig(t, test.config))
if err != nil {
t.Fatal(err)
}
}

t.Run(name, func(t *testing.T) {
Expand All @@ -275,7 +278,8 @@ func TestKafkaPublish(t *testing.T) {
t.Fatal(err)
}

output := grp.Clients[0].(*client)
output, ok := grp.Clients[0].(*client)
assert.True(t, ok, "grp.Clients[0] didn't contain a ptr to client")
if err := output.Connect(); err != nil {
t.Fatal(err)
}
Expand All @@ -291,7 +295,10 @@ func TestKafkaPublish(t *testing.T) {
}

wg.Add(1)
output.Publish(context.Background(), batch)
err := output.Publish(context.Background(), batch)
if err != nil {
t.Fatal(err)
}
}

// wait for all published batches to be ACKed
Expand Down Expand Up @@ -347,7 +354,8 @@ func validateJSON(t *testing.T, value []byte, events []beat.Event) string {
return ""
}

msg := decoded["message"].(string)
msg, ok := decoded["message"].(string)
assert.True(t, ok, "type of decoded message was not string")
event := findEvent(events, msg)
if event == nil {
t.Errorf("could not find expected event with message: %v", msg)
Expand Down

0 comments on commit bcbdefa

Please sign in to comment.