github.com/mailgun/holster/v4@v4.20.0/tracing/mock_span_processor_test.go (about)

     1  package tracing_test
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/stretchr/testify/mock"
     7  	sdktrace "go.opentelemetry.io/otel/sdk/trace"
     8  )
     9  
    10  // MockSpanProcessor mocks interface SpanProcessor.
    11  type MockSpanProcessor struct {
    12  	mock.Mock
    13  }
    14  
    15  func (m *MockSpanProcessor) OnStart(ctx context.Context, s sdktrace.ReadWriteSpan) {
    16  	m.Called(ctx, s)
    17  }
    18  
    19  func (m *MockSpanProcessor) OnEnd(s sdktrace.ReadOnlySpan) {
    20  	m.Called(s)
    21  }
    22  
    23  func (m *MockSpanProcessor) ForceFlush(ctx context.Context) error {
    24  	args := m.Called(ctx)
    25  	return args.Error(0)
    26  }
    27  
    28  func (m *MockSpanProcessor) Shutdown(ctx context.Context) error {
    29  	args := m.Called(ctx)
    30  	return args.Error(0)
    31  }