Skip to content

Commit

Permalink
[chore] Remove use of ReportFatalError (#31103)
Browse files Browse the repository at this point in the history
**Description:**
Remove use of `ReportFatalError` in mock host.

Fixes #30599
  • Loading branch information
atoulme authored Feb 8, 2024
1 parent 6f353c5 commit 94889fb
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions receiver/purefareceiver/internal/bearertoken_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/config/configauth"
"go.opentelemetry.io/collector/extension/extensiontest"

Expand All @@ -29,6 +30,7 @@ func TestBearerToken(t *testing.T) {
baComponentName := component.NewIDWithName("bearertokenauth", "array01")

host := &mockHost{
Host: componenttest.NewNopHost(),
extensions: map[component.ID]component.Component{
baComponentName: baExt,
},
Expand All @@ -47,19 +49,10 @@ func TestBearerToken(t *testing.T) {
}

type mockHost struct {
component.Host
extensions map[component.ID]component.Component
}

func (h *mockHost) ReportFatalError(_ error) {}

func (h *mockHost) GetFactory(_ component.Kind, _ component.Type) component.Factory {
return nil
}

func (h *mockHost) GetExtensions() map[component.ID]component.Component {
return h.extensions
}

func (h *mockHost) GetExporters() map[component.DataType]map[component.ID]component.Component {
return nil
}

0 comments on commit 94889fb

Please sign in to comment.