mirror of
https://github.com/getAlby/hub.git
synced 2026-08-13 12:33:39 +02:00
* feat: read only JWT for http api use * fix: pass permission to start and unlock endpoints * chore: add http service JWT tests * chore: update mocks * fix: close db in tests
208 lines
7 KiB
Go
208 lines
7 KiB
Go
// Code generated by mockery; DO NOT EDIT.
|
|
// github.com/vektra/mockery
|
|
// template: testify
|
|
|
|
package mocks
|
|
|
|
import (
|
|
"github.com/getAlby/hub/events"
|
|
mock "github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
// NewMockEventPublisher creates a new instance of MockEventPublisher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
|
|
// The first argument is typically a *testing.T value.
|
|
func NewMockEventPublisher(t interface {
|
|
mock.TestingT
|
|
Cleanup(func())
|
|
}) *MockEventPublisher {
|
|
mock := &MockEventPublisher{}
|
|
mock.Mock.Test(t)
|
|
|
|
t.Cleanup(func() { mock.AssertExpectations(t) })
|
|
|
|
return mock
|
|
}
|
|
|
|
// MockEventPublisher is an autogenerated mock type for the EventPublisher type
|
|
type MockEventPublisher struct {
|
|
mock.Mock
|
|
}
|
|
|
|
type MockEventPublisher_Expecter struct {
|
|
mock *mock.Mock
|
|
}
|
|
|
|
func (_m *MockEventPublisher) EXPECT() *MockEventPublisher_Expecter {
|
|
return &MockEventPublisher_Expecter{mock: &_m.Mock}
|
|
}
|
|
|
|
// Publish provides a mock function for the type MockEventPublisher
|
|
func (_mock *MockEventPublisher) Publish(event *events.Event) {
|
|
_mock.Called(event)
|
|
return
|
|
}
|
|
|
|
// MockEventPublisher_Publish_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Publish'
|
|
type MockEventPublisher_Publish_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// Publish is a helper method to define mock.On call
|
|
// - event
|
|
func (_e *MockEventPublisher_Expecter) Publish(event interface{}) *MockEventPublisher_Publish_Call {
|
|
return &MockEventPublisher_Publish_Call{Call: _e.mock.On("Publish", event)}
|
|
}
|
|
|
|
func (_c *MockEventPublisher_Publish_Call) Run(run func(event *events.Event)) *MockEventPublisher_Publish_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(*events.Event))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockEventPublisher_Publish_Call) Return() *MockEventPublisher_Publish_Call {
|
|
_c.Call.Return()
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockEventPublisher_Publish_Call) RunAndReturn(run func(event *events.Event)) *MockEventPublisher_Publish_Call {
|
|
_c.Run(run)
|
|
return _c
|
|
}
|
|
|
|
// PublishSync provides a mock function for the type MockEventPublisher
|
|
func (_mock *MockEventPublisher) PublishSync(event *events.Event) {
|
|
_mock.Called(event)
|
|
return
|
|
}
|
|
|
|
// MockEventPublisher_PublishSync_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PublishSync'
|
|
type MockEventPublisher_PublishSync_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// PublishSync is a helper method to define mock.On call
|
|
// - event
|
|
func (_e *MockEventPublisher_Expecter) PublishSync(event interface{}) *MockEventPublisher_PublishSync_Call {
|
|
return &MockEventPublisher_PublishSync_Call{Call: _e.mock.On("PublishSync", event)}
|
|
}
|
|
|
|
func (_c *MockEventPublisher_PublishSync_Call) Run(run func(event *events.Event)) *MockEventPublisher_PublishSync_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(*events.Event))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockEventPublisher_PublishSync_Call) Return() *MockEventPublisher_PublishSync_Call {
|
|
_c.Call.Return()
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockEventPublisher_PublishSync_Call) RunAndReturn(run func(event *events.Event)) *MockEventPublisher_PublishSync_Call {
|
|
_c.Run(run)
|
|
return _c
|
|
}
|
|
|
|
// RegisterSubscriber provides a mock function for the type MockEventPublisher
|
|
func (_mock *MockEventPublisher) RegisterSubscriber(eventListener events.EventSubscriber) {
|
|
_mock.Called(eventListener)
|
|
return
|
|
}
|
|
|
|
// MockEventPublisher_RegisterSubscriber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RegisterSubscriber'
|
|
type MockEventPublisher_RegisterSubscriber_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// RegisterSubscriber is a helper method to define mock.On call
|
|
// - eventListener
|
|
func (_e *MockEventPublisher_Expecter) RegisterSubscriber(eventListener interface{}) *MockEventPublisher_RegisterSubscriber_Call {
|
|
return &MockEventPublisher_RegisterSubscriber_Call{Call: _e.mock.On("RegisterSubscriber", eventListener)}
|
|
}
|
|
|
|
func (_c *MockEventPublisher_RegisterSubscriber_Call) Run(run func(eventListener events.EventSubscriber)) *MockEventPublisher_RegisterSubscriber_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(events.EventSubscriber))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockEventPublisher_RegisterSubscriber_Call) Return() *MockEventPublisher_RegisterSubscriber_Call {
|
|
_c.Call.Return()
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockEventPublisher_RegisterSubscriber_Call) RunAndReturn(run func(eventListener events.EventSubscriber)) *MockEventPublisher_RegisterSubscriber_Call {
|
|
_c.Run(run)
|
|
return _c
|
|
}
|
|
|
|
// RemoveSubscriber provides a mock function for the type MockEventPublisher
|
|
func (_mock *MockEventPublisher) RemoveSubscriber(eventListener events.EventSubscriber) {
|
|
_mock.Called(eventListener)
|
|
return
|
|
}
|
|
|
|
// MockEventPublisher_RemoveSubscriber_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveSubscriber'
|
|
type MockEventPublisher_RemoveSubscriber_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// RemoveSubscriber is a helper method to define mock.On call
|
|
// - eventListener
|
|
func (_e *MockEventPublisher_Expecter) RemoveSubscriber(eventListener interface{}) *MockEventPublisher_RemoveSubscriber_Call {
|
|
return &MockEventPublisher_RemoveSubscriber_Call{Call: _e.mock.On("RemoveSubscriber", eventListener)}
|
|
}
|
|
|
|
func (_c *MockEventPublisher_RemoveSubscriber_Call) Run(run func(eventListener events.EventSubscriber)) *MockEventPublisher_RemoveSubscriber_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(events.EventSubscriber))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockEventPublisher_RemoveSubscriber_Call) Return() *MockEventPublisher_RemoveSubscriber_Call {
|
|
_c.Call.Return()
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockEventPublisher_RemoveSubscriber_Call) RunAndReturn(run func(eventListener events.EventSubscriber)) *MockEventPublisher_RemoveSubscriber_Call {
|
|
_c.Run(run)
|
|
return _c
|
|
}
|
|
|
|
// SetGlobalProperty provides a mock function for the type MockEventPublisher
|
|
func (_mock *MockEventPublisher) SetGlobalProperty(key string, value interface{}) {
|
|
_mock.Called(key, value)
|
|
return
|
|
}
|
|
|
|
// MockEventPublisher_SetGlobalProperty_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetGlobalProperty'
|
|
type MockEventPublisher_SetGlobalProperty_Call struct {
|
|
*mock.Call
|
|
}
|
|
|
|
// SetGlobalProperty is a helper method to define mock.On call
|
|
// - key
|
|
// - value
|
|
func (_e *MockEventPublisher_Expecter) SetGlobalProperty(key interface{}, value interface{}) *MockEventPublisher_SetGlobalProperty_Call {
|
|
return &MockEventPublisher_SetGlobalProperty_Call{Call: _e.mock.On("SetGlobalProperty", key, value)}
|
|
}
|
|
|
|
func (_c *MockEventPublisher_SetGlobalProperty_Call) Run(run func(key string, value interface{})) *MockEventPublisher_SetGlobalProperty_Call {
|
|
_c.Call.Run(func(args mock.Arguments) {
|
|
run(args[0].(string), args[1].(interface{}))
|
|
})
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockEventPublisher_SetGlobalProperty_Call) Return() *MockEventPublisher_SetGlobalProperty_Call {
|
|
_c.Call.Return()
|
|
return _c
|
|
}
|
|
|
|
func (_c *MockEventPublisher_SetGlobalProperty_Call) RunAndReturn(run func(key string, value interface{})) *MockEventPublisher_SetGlobalProperty_Call {
|
|
_c.Run(run)
|
|
return _c
|
|
}
|