github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/p2p/mock/subscription.go (about)

     1  // Code generated by mockery v2.21.4. DO NOT EDIT.
     2  
     3  package mockp2p
     4  
     5  import (
     6  	context "context"
     7  
     8  	mock "github.com/stretchr/testify/mock"
     9  
    10  	pubsub "github.com/libp2p/go-libp2p-pubsub"
    11  )
    12  
    13  // Subscription is an autogenerated mock type for the Subscription type
    14  type Subscription struct {
    15  	mock.Mock
    16  }
    17  
    18  // Cancel provides a mock function with given fields:
    19  func (_m *Subscription) Cancel() {
    20  	_m.Called()
    21  }
    22  
    23  // Next provides a mock function with given fields: _a0
    24  func (_m *Subscription) Next(_a0 context.Context) (*pubsub.Message, error) {
    25  	ret := _m.Called(_a0)
    26  
    27  	var r0 *pubsub.Message
    28  	var r1 error
    29  	if rf, ok := ret.Get(0).(func(context.Context) (*pubsub.Message, error)); ok {
    30  		return rf(_a0)
    31  	}
    32  	if rf, ok := ret.Get(0).(func(context.Context) *pubsub.Message); ok {
    33  		r0 = rf(_a0)
    34  	} else {
    35  		if ret.Get(0) != nil {
    36  			r0 = ret.Get(0).(*pubsub.Message)
    37  		}
    38  	}
    39  
    40  	if rf, ok := ret.Get(1).(func(context.Context) error); ok {
    41  		r1 = rf(_a0)
    42  	} else {
    43  		r1 = ret.Error(1)
    44  	}
    45  
    46  	return r0, r1
    47  }
    48  
    49  // Topic provides a mock function with given fields:
    50  func (_m *Subscription) Topic() string {
    51  	ret := _m.Called()
    52  
    53  	var r0 string
    54  	if rf, ok := ret.Get(0).(func() string); ok {
    55  		r0 = rf()
    56  	} else {
    57  		r0 = ret.Get(0).(string)
    58  	}
    59  
    60  	return r0
    61  }
    62  
    63  type mockConstructorTestingTNewSubscription interface {
    64  	mock.TestingT
    65  	Cleanup(func())
    66  }
    67  
    68  // NewSubscription creates a new instance of Subscription. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
    69  func NewSubscription(t mockConstructorTestingTNewSubscription) *Subscription {
    70  	mock := &Subscription{}
    71  	mock.Mock.Test(t)
    72  
    73  	t.Cleanup(func() { mock.AssertExpectations(t) })
    74  
    75  	return mock
    76  }