mirror of
https://github.com/hanzoai/telemetry.git
synced 2026-10-30 20:01:49 +00:00
#### Description Testifylint is a linter that provides best practices with the use of testify. This PR enables [require-error](https://github.com/Antonboom/testifylint?tab=readme-ov-file#require-error) rule from [testifylint](https://github.com/Antonboom/testifylint) Signed-off-by: Matthieu MOREL <[email protected]>
27 lines
630 B
Go
27 lines
630 B
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package testcomponents
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"go.opentelemetry.io/collector/component/componenttest"
|
|
)
|
|
|
|
func TestExampleConnector(t *testing.T) {
|
|
conn := &ExampleConnector{}
|
|
host := componenttest.NewNopHost()
|
|
assert.False(t, conn.Started())
|
|
require.NoError(t, conn.Start(context.Background(), host))
|
|
assert.True(t, conn.Started())
|
|
|
|
assert.False(t, conn.Stopped())
|
|
require.NoError(t, conn.Shutdown(context.Background()))
|
|
assert.True(t, conn.Stopped())
|
|
}
|