github.com/grafana/pyroscope@v1.18.0/pkg/test/mocks/mockmetrics/mock_exporter.go (about) 1 // Code generated by mockery. DO NOT EDIT. 2 3 package mockmetrics 4 5 import ( 6 prompb "github.com/prometheus/prometheus/prompb" 7 mock "github.com/stretchr/testify/mock" 8 ) 9 10 // MockExporter is an autogenerated mock type for the Exporter type 11 type MockExporter struct { 12 mock.Mock 13 } 14 15 type MockExporter_Expecter struct { 16 mock *mock.Mock 17 } 18 19 func (_m *MockExporter) EXPECT() *MockExporter_Expecter { 20 return &MockExporter_Expecter{mock: &_m.Mock} 21 } 22 23 // Flush provides a mock function with no fields 24 func (_m *MockExporter) Flush() { 25 _m.Called() 26 } 27 28 // MockExporter_Flush_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Flush' 29 type MockExporter_Flush_Call struct { 30 *mock.Call 31 } 32 33 // Flush is a helper method to define mock.On call 34 func (_e *MockExporter_Expecter) Flush() *MockExporter_Flush_Call { 35 return &MockExporter_Flush_Call{Call: _e.mock.On("Flush")} 36 } 37 38 func (_c *MockExporter_Flush_Call) Run(run func()) *MockExporter_Flush_Call { 39 _c.Call.Run(func(args mock.Arguments) { 40 run() 41 }) 42 return _c 43 } 44 45 func (_c *MockExporter_Flush_Call) Return() *MockExporter_Flush_Call { 46 _c.Call.Return() 47 return _c 48 } 49 50 func (_c *MockExporter_Flush_Call) RunAndReturn(run func()) *MockExporter_Flush_Call { 51 _c.Run(run) 52 return _c 53 } 54 55 // Send provides a mock function with given fields: tenant, series 56 func (_m *MockExporter) Send(tenant string, series []prompb.TimeSeries) error { 57 ret := _m.Called(tenant, series) 58 59 if len(ret) == 0 { 60 panic("no return value specified for Send") 61 } 62 63 var r0 error 64 if rf, ok := ret.Get(0).(func(string, []prompb.TimeSeries) error); ok { 65 r0 = rf(tenant, series) 66 } else { 67 r0 = ret.Error(0) 68 } 69 70 return r0 71 } 72 73 // MockExporter_Send_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Send' 74 type MockExporter_Send_Call struct { 75 *mock.Call 76 } 77 78 // Send is a helper method to define mock.On call 79 // - tenant string 80 // - series []prompb.TimeSeries 81 func (_e *MockExporter_Expecter) Send(tenant interface{}, series interface{}) *MockExporter_Send_Call { 82 return &MockExporter_Send_Call{Call: _e.mock.On("Send", tenant, series)} 83 } 84 85 func (_c *MockExporter_Send_Call) Run(run func(tenant string, series []prompb.TimeSeries)) *MockExporter_Send_Call { 86 _c.Call.Run(func(args mock.Arguments) { 87 run(args[0].(string), args[1].([]prompb.TimeSeries)) 88 }) 89 return _c 90 } 91 92 func (_c *MockExporter_Send_Call) Return(_a0 error) *MockExporter_Send_Call { 93 _c.Call.Return(_a0) 94 return _c 95 } 96 97 func (_c *MockExporter_Send_Call) RunAndReturn(run func(string, []prompb.TimeSeries) error) *MockExporter_Send_Call { 98 _c.Call.Return(run) 99 return _c 100 } 101 102 // NewMockExporter creates a new instance of MockExporter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 103 // The first argument is typically a *testing.T value. 104 func NewMockExporter(t interface { 105 mock.TestingT 106 Cleanup(func()) 107 }) *MockExporter { 108 mock := &MockExporter{} 109 mock.Mock.Test(t) 110 111 t.Cleanup(func() { mock.AssertExpectations(t) }) 112 113 return mock 114 }