github.com/grafana/pyroscope@v1.18.0/pkg/test/mocks/mockotlp/mock_push_service.go (about)

     1  // Code generated by mockery. DO NOT EDIT.
     2  
     3  package mockotlp
     4  
     5  import (
     6  	context "context"
     7  
     8  	model "github.com/grafana/pyroscope/pkg/distributor/model"
     9  	mock "github.com/stretchr/testify/mock"
    10  )
    11  
    12  // MockPushService is an autogenerated mock type for the PushService type
    13  type MockPushService struct {
    14  	mock.Mock
    15  }
    16  
    17  type MockPushService_Expecter struct {
    18  	mock *mock.Mock
    19  }
    20  
    21  func (_m *MockPushService) EXPECT() *MockPushService_Expecter {
    22  	return &MockPushService_Expecter{mock: &_m.Mock}
    23  }
    24  
    25  // PushBatch provides a mock function with given fields: ctx, req
    26  func (_m *MockPushService) PushBatch(ctx context.Context, req *model.PushRequest) error {
    27  	ret := _m.Called(ctx, req)
    28  
    29  	if len(ret) == 0 {
    30  		panic("no return value specified for PushBatch")
    31  	}
    32  
    33  	var r0 error
    34  	if rf, ok := ret.Get(0).(func(context.Context, *model.PushRequest) error); ok {
    35  		r0 = rf(ctx, req)
    36  	} else {
    37  		r0 = ret.Error(0)
    38  	}
    39  
    40  	return r0
    41  }
    42  
    43  // MockPushService_PushBatch_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PushBatch'
    44  type MockPushService_PushBatch_Call struct {
    45  	*mock.Call
    46  }
    47  
    48  // PushBatch is a helper method to define mock.On call
    49  //   - ctx context.Context
    50  //   - req *model.PushRequest
    51  func (_e *MockPushService_Expecter) PushBatch(ctx interface{}, req interface{}) *MockPushService_PushBatch_Call {
    52  	return &MockPushService_PushBatch_Call{Call: _e.mock.On("PushBatch", ctx, req)}
    53  }
    54  
    55  func (_c *MockPushService_PushBatch_Call) Run(run func(ctx context.Context, req *model.PushRequest)) *MockPushService_PushBatch_Call {
    56  	_c.Call.Run(func(args mock.Arguments) {
    57  		run(args[0].(context.Context), args[1].(*model.PushRequest))
    58  	})
    59  	return _c
    60  }
    61  
    62  func (_c *MockPushService_PushBatch_Call) Return(_a0 error) *MockPushService_PushBatch_Call {
    63  	_c.Call.Return(_a0)
    64  	return _c
    65  }
    66  
    67  func (_c *MockPushService_PushBatch_Call) RunAndReturn(run func(context.Context, *model.PushRequest) error) *MockPushService_PushBatch_Call {
    68  	_c.Call.Return(run)
    69  	return _c
    70  }
    71  
    72  // NewMockPushService creates a new instance of MockPushService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
    73  // The first argument is typically a *testing.T value.
    74  func NewMockPushService(t interface {
    75  	mock.TestingT
    76  	Cleanup(func())
    77  }) *MockPushService {
    78  	mock := &MockPushService{}
    79  	mock.Mock.Test(t)
    80  
    81  	t.Cleanup(func() { mock.AssertExpectations(t) })
    82  
    83  	return mock
    84  }