diff --git a/controller/mocks/HandleSubscribeResponse.go b/controller/mocks/HandleSubscribeResponse.go new file mode 100644 index 0000000000000000000000000000000000000000..07d3feeda850107c25b8b08f6eef12d20d3c7a02 --- /dev/null +++ b/controller/mocks/HandleSubscribeResponse.go @@ -0,0 +1,35 @@ +// Code generated by mockery v2.14.0. DO NOT EDIT. + +package mocks + +import ( + gnmi "github.com/openconfig/gnmi/proto/gnmi" + mock "github.com/stretchr/testify/mock" + + transport "code.fbi.h-da.de/danet/gosdn/controller/interfaces/transport" +) + +// HandleSubscribeResponse is an autogenerated mock type for the HandleSubscribeResponse type +type HandleSubscribeResponse struct { + mock.Mock +} + +// Execute provides a mock function with given fields: _a0, _a1 +func (_m *HandleSubscribeResponse) Execute(_a0 *gnmi.SubscribeResponse, _a1 *transport.SubscriptionInformation) { + _m.Called(_a0, _a1) +} + +type mockConstructorTestingTNewHandleSubscribeResponse interface { + mock.TestingT + Cleanup(func()) +} + +// NewHandleSubscribeResponse creates a new instance of HandleSubscribeResponse. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewHandleSubscribeResponse(t mockConstructorTestingTNewHandleSubscribeResponse) *HandleSubscribeResponse { + mock := &HandleSubscribeResponse{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/controller/mocks/Store.go b/controller/mocks/Store.go index 6ce0fd98513a962eeea46f362bd24474bcdc99db..f8f71cd7da2b2719058248e965e8a591a1d3f764 100644 --- a/controller/mocks/Store.go +++ b/controller/mocks/Store.go @@ -3,8 +3,8 @@ package mocks import ( - store "code.fbi.h-da.de/danet/gosdn/controller/interfaces/store" - uuid "github.com/google/uuid" + southbound "code.fbi.h-da.de/danet/gosdn/controller/interfaces/southbound" + store "code.fbi.h-da.de/danet/gosdn/controller/store" mock "github.com/stretchr/testify/mock" ) @@ -13,13 +13,13 @@ type Store struct { mock.Mock } -// Add provides a mock function with given fields: item -func (_m *Store) Add(item store.Storable) error { - ret := _m.Called(item) +// Add provides a mock function with given fields: _a0 +func (_m *Store) Add(_a0 southbound.SouthboundInterface) error { + ret := _m.Called(_a0) var r0 error - if rf, ok := ret.Get(0).(func(store.Storable) error); ok { - r0 = rf(item) + if rf, ok := ret.Get(0).(func(southbound.SouthboundInterface) error); ok { + r0 = rf(_a0) } else { r0 = ret.Error(0) } @@ -27,13 +27,13 @@ func (_m *Store) Add(item store.Storable) error { return r0 } -// Delete provides a mock function with given fields: id -func (_m *Store) Delete(id uuid.UUID) error { - ret := _m.Called(id) +// Delete provides a mock function with given fields: _a0 +func (_m *Store) Delete(_a0 southbound.SouthboundInterface) error { + ret := _m.Called(_a0) var r0 error - if rf, ok := ret.Get(0).(func(uuid.UUID) error); ok { - r0 = rf(id) + if rf, ok := ret.Get(0).(func(southbound.SouthboundInterface) error); ok { + r0 = rf(_a0) } else { r0 = ret.Error(0) } @@ -41,36 +41,20 @@ func (_m *Store) Delete(id uuid.UUID) error { return r0 } -// Exists provides a mock function with given fields: id -func (_m *Store) Exists(id uuid.UUID) bool { - ret := _m.Called(id) +// Get provides a mock function with given fields: _a0 +func (_m *Store) Get(_a0 store.Query) (southbound.LoadedSbi, error) { + ret := _m.Called(_a0) - var r0 bool - if rf, ok := ret.Get(0).(func(uuid.UUID) bool); ok { - r0 = rf(id) + var r0 southbound.LoadedSbi + if rf, ok := ret.Get(0).(func(store.Query) southbound.LoadedSbi); ok { + r0 = rf(_a0) } else { - r0 = ret.Get(0).(bool) - } - - return r0 -} - -// Get provides a mock function with given fields: id -func (_m *Store) Get(id uuid.UUID) (store.Storable, error) { - ret := _m.Called(id) - - var r0 store.Storable - if rf, ok := ret.Get(0).(func(uuid.UUID) store.Storable); ok { - r0 = rf(id) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(store.Storable) - } + r0 = ret.Get(0).(southbound.LoadedSbi) } var r1 error - if rf, ok := ret.Get(1).(func(uuid.UUID) error); ok { - r1 = rf(id) + if rf, ok := ret.Get(1).(func(store.Query) error); ok { + r1 = rf(_a0) } else { r1 = ret.Error(1) } @@ -78,20 +62,27 @@ func (_m *Store) Get(id uuid.UUID) (store.Storable, error) { return r0, r1 } -// UUIDs provides a mock function with given fields: -func (_m *Store) UUIDs() []uuid.UUID { +// GetAll provides a mock function with given fields: +func (_m *Store) GetAll() ([]southbound.LoadedSbi, error) { ret := _m.Called() - var r0 []uuid.UUID - if rf, ok := ret.Get(0).(func() []uuid.UUID); ok { + var r0 []southbound.LoadedSbi + if rf, ok := ret.Get(0).(func() []southbound.LoadedSbi); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]uuid.UUID) + r0 = ret.Get(0).([]southbound.LoadedSbi) } } - return r0 + var r1 error + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 } type mockConstructorTestingTNewStore interface {