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

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