Skip to content
Snippets Groups Projects
Plugin.go 7.49 KiB
Newer Older
  • Learn to ignore specific revisions
  • // Code generated by mockery v2.20.0. DO NOT EDIT.
    
    	go_plugin "github.com/hashicorp/go-plugin"
    	gnmi "github.com/openconfig/gnmi/proto/gnmi"
    
    	mock "github.com/stretchr/testify/mock"
    
    
    	networkelement "code.fbi.h-da.de/danet/gosdn/api/go/gosdn/networkelement"
    
    	plugin "code.fbi.h-da.de/danet/gosdn/controller/interfaces/plugin"
    
    	uuid "github.com/google/uuid"
    
    )
    
    // Plugin is an autogenerated mock type for the Plugin type
    type Plugin struct {
    	mock.Mock
    }
    
    
    // Close provides a mock function with given fields:
    func (_m *Plugin) Close() {
    	_m.Called()
    }
    
    // DeleteNode provides a mock function with given fields: path
    func (_m *Plugin) DeleteNode(path *gnmi.Path) error {
    	ret := _m.Called(path)
    
    	var r0 error
    	if rf, ok := ret.Get(0).(func(*gnmi.Path) error); ok {
    		r0 = rf(path)
    	} else {
    		r0 = ret.Error(0)
    	}
    
    	return r0
    }
    
    // Diff provides a mock function with given fields: original, modified
    func (_m *Plugin) Diff(original []byte, modified []byte) (*gnmi.Notification, error) {
    	ret := _m.Called(original, modified)
    
    	var r0 *gnmi.Notification
    	var r1 error
    	if rf, ok := ret.Get(0).(func([]byte, []byte) (*gnmi.Notification, error)); ok {
    		return rf(original, modified)
    	}
    	if rf, ok := ret.Get(0).(func([]byte, []byte) *gnmi.Notification); ok {
    		r0 = rf(original, modified)
    	} else {
    		if ret.Get(0) != nil {
    			r0 = ret.Get(0).(*gnmi.Notification)
    		}
    	}
    
    	if rf, ok := ret.Get(1).(func([]byte, []byte) error); ok {
    		r1 = rf(original, modified)
    	} else {
    		r1 = ret.Error(1)
    	}
    
    	return r0, r1
    }
    
    
    // ExecPath provides a mock function with given fields:
    func (_m *Plugin) ExecPath() string {
    	ret := _m.Called()
    
    	var r0 string
    	if rf, ok := ret.Get(0).(func() string); ok {
    		r0 = rf()
    	} else {
    		r0 = ret.Get(0).(string)
    	}
    
    	return r0
    }
    
    
    // GetClient provides a mock function with given fields:
    func (_m *Plugin) GetClient() *go_plugin.Client {
    	ret := _m.Called()
    
    	var r0 *go_plugin.Client
    	if rf, ok := ret.Get(0).(func() *go_plugin.Client); ok {
    		r0 = rf()
    	} else {
    		if ret.Get(0) != nil {
    			r0 = ret.Get(0).(*go_plugin.Client)
    		}
    	}
    
    	return r0
    }
    
    // GetNode provides a mock function with given fields: path
    func (_m *Plugin) GetNode(path *gnmi.Path) ([]*gnmi.Notification, error) {
    	ret := _m.Called(path)
    
    	var r0 []*gnmi.Notification
    	var r1 error
    	if rf, ok := ret.Get(0).(func(*gnmi.Path) ([]*gnmi.Notification, error)); ok {
    		return rf(path)
    	}
    	if rf, ok := ret.Get(0).(func(*gnmi.Path) []*gnmi.Notification); ok {
    		r0 = rf(path)
    	} else {
    		if ret.Get(0) != nil {
    			r0 = ret.Get(0).([]*gnmi.Notification)
    		}
    	}
    
    	if rf, ok := ret.Get(1).(func(*gnmi.Path) error); ok {
    		r1 = rf(path)
    	} else {
    		r1 = ret.Error(1)
    	}
    
    	return r0, r1
    }
    
    
    // ID provides a mock function with given fields:
    func (_m *Plugin) ID() uuid.UUID {
    	ret := _m.Called()
    
    	var r0 uuid.UUID
    	if rf, ok := ret.Get(0).(func() uuid.UUID); ok {
    		r0 = rf()
    	} else {
    		if ret.Get(0) != nil {
    			r0 = ret.Get(0).(uuid.UUID)
    		}
    	}
    
    	return r0
    }
    
    // Manifest provides a mock function with given fields:
    func (_m *Plugin) Manifest() *plugin.Manifest {
    	ret := _m.Called()
    
    	var r0 *plugin.Manifest
    	if rf, ok := ret.Get(0).(func() *plugin.Manifest); ok {
    		r0 = rf()
    	} else {
    		if ret.Get(0) != nil {
    			r0 = ret.Get(0).(*plugin.Manifest)
    		}
    	}
    
    	return r0
    }
    
    
    // Model provides a mock function with given fields: filterReadOnly
    func (_m *Plugin) Model(filterReadOnly bool) ([]byte, error) {
    	ret := _m.Called(filterReadOnly)
    
    	var r0 []byte
    	var r1 error
    	if rf, ok := ret.Get(0).(func(bool) ([]byte, error)); ok {
    		return rf(filterReadOnly)
    	}
    	if rf, ok := ret.Get(0).(func(bool) []byte); ok {
    		r0 = rf(filterReadOnly)
    	} else {
    		if ret.Get(0) != nil {
    			r0 = ret.Get(0).([]byte)
    		}
    	}
    
    	if rf, ok := ret.Get(1).(func(bool) error); ok {
    		r1 = rf(filterReadOnly)
    	} else {
    		r1 = ret.Error(1)
    	}
    
    	return r0, r1
    }
    
    // Ping provides a mock function with given fields:
    func (_m *Plugin) Ping() error {
    
    	var r0 error
    	if rf, ok := ret.Get(0).(func() error); ok {
    
    		r0 = ret.Error(0)
    	}
    
    	return r0
    }
    
    // PruneConfigFalse provides a mock function with given fields: value
    func (_m *Plugin) PruneConfigFalse(value []byte) ([]byte, error) {
    	ret := _m.Called(value)
    
    	var r0 []byte
    	var r1 error
    	if rf, ok := ret.Get(0).(func([]byte) ([]byte, error)); ok {
    		return rf(value)
    	}
    	if rf, ok := ret.Get(0).(func([]byte) []byte); ok {
    		r0 = rf(value)
    	} else {
    		if ret.Get(0) != nil {
    			r0 = ret.Get(0).([]byte)
    		}
    	}
    
    	if rf, ok := ret.Get(1).(func([]byte) error); ok {
    		r1 = rf(value)
    	} else {
    		r1 = ret.Error(1)
    	}
    
    	return r0, r1
    }
    
    // Restart provides a mock function with given fields:
    func (_m *Plugin) Restart() error {
    	ret := _m.Called()
    
    	var r0 error
    	if rf, ok := ret.Get(0).(func() error); ok {
    		r0 = rf()
    	} else {
    		r0 = ret.Error(0)
    	}
    
    	return r0
    }
    
    // SchemaTreeGzip provides a mock function with given fields:
    func (_m *Plugin) SchemaTreeGzip() ([]byte, error) {
    	ret := _m.Called()
    
    	var r0 []byte
    	var r1 error
    	if rf, ok := ret.Get(0).(func() ([]byte, error)); ok {
    		return rf()
    	}
    	if rf, ok := ret.Get(0).(func() []byte); ok {
    		r0 = rf()
    	} else {
    		if ret.Get(0) != nil {
    			r0 = ret.Get(0).([]byte)
    		}
    	}
    
    	if rf, ok := ret.Get(1).(func() error); ok {
    		r1 = rf()
    	} else {
    		r1 = ret.Error(1)
    	}
    
    	return r0, r1
    }
    
    // SetNode provides a mock function with given fields: path, value
    func (_m *Plugin) SetNode(path *gnmi.Path, value *gnmi.TypedValue) error {
    	ret := _m.Called(path, value)
    
    	var r0 error
    	if rf, ok := ret.Get(0).(func(*gnmi.Path, *gnmi.TypedValue) error); ok {
    		r0 = rf(path, value)
    	} else {
    		r0 = ret.Error(0)
    
    	}
    
    	return r0
    }
    
    // State provides a mock function with given fields:
    func (_m *Plugin) State() plugin.State {
    	ret := _m.Called()
    
    	var r0 plugin.State
    	if rf, ok := ret.Get(0).(func() plugin.State); ok {
    		r0 = rf()
    	} else {
    		r0 = ret.Get(0).(plugin.State)
    	}
    
    	return r0
    }
    
    
    // Unmarshal provides a mock function with given fields: json, path
    func (_m *Plugin) Unmarshal(json []byte, path *gnmi.Path) error {
    	ret := _m.Called(json, path)
    
    	var r0 error
    	if rf, ok := ret.Get(0).(func([]byte, *gnmi.Path) error); ok {
    		r0 = rf(json, path)
    	} else {
    		r0 = ret.Error(0)
    	}
    
    	return r0
    }
    
    
    // Update provides a mock function with given fields:
    func (_m *Plugin) Update() error {
    	ret := _m.Called()
    
    	var r0 error
    	if rf, ok := ret.Get(0).(func() error); ok {
    		r0 = rf()
    	} else {
    		r0 = ret.Error(0)
    	}
    
    	return r0
    }
    
    // ValidateChange provides a mock function with given fields: operation, path, value
    
    func (_m *Plugin) ValidateChange(operation networkelement.ApiOperation, path *gnmi.Path, value []byte) ([]byte, error) {
    
    	ret := _m.Called(operation, path, value)
    
    	var r0 []byte
    	var r1 error
    
    	if rf, ok := ret.Get(0).(func(networkelement.ApiOperation, *gnmi.Path, []byte) ([]byte, error)); ok {
    
    	if rf, ok := ret.Get(0).(func(networkelement.ApiOperation, *gnmi.Path, []byte) []byte); ok {
    
    		r0 = rf(operation, path, value)
    	} else {
    		if ret.Get(0) != nil {
    			r0 = ret.Get(0).([]byte)
    		}
    	}
    
    
    	if rf, ok := ret.Get(1).(func(networkelement.ApiOperation, *gnmi.Path, []byte) error); ok {
    
    		r1 = rf(operation, path, value)
    	} else {
    		r1 = ret.Error(1)
    	}
    
    	return r0, r1
    }
    
    
    type mockConstructorTestingTNewPlugin interface {
    	mock.TestingT
    	Cleanup(func())
    }
    
    // NewPlugin creates a new instance of Plugin. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
    func NewPlugin(t mockConstructorTestingTNewPlugin) *Plugin {
    
    
    	t.Cleanup(func() { mock.AssertExpectations(t) })
    
    	return mock
    }