alby-hub/tests/mocks/AlbyOAuthService.go
saunter 23dccc6c6f
feat: stories (#2172)
* feat: integrate Stories widget with backend endpoint

Add stories endpoint plumbing for HTTP and Wails, wire the Home Stories card
to fetch from /api/alby/stories, and keep it first in the right column.

Made-with: Cursor

* feat(home): story modal CTAs and preview fallback

- Add contextual actions in the story dialog (update hub with version,
  open Alby Go in-app, install extension) keyed by kind or title
- Use preview stories when the stories API request fails
- Pass hub version from useInfo into the update link

Made-with: Cursor

* feat(stories): polish modal, drop preview fallback

- Widen modal and put video edge-to-edge with overlay close button
- Drop verbose header and 'Watch on YouTube' button
- Remove previewStories fallback so widget hides until upstream API ships
- Tighten title line-height

* feat(stories): render cta from API instead of mapping by kind

Move CTA copy and URLs into the API response. Hub renders story.cta
directly, so adding new story types no longer requires a hub release.

* chore(csp): allow cdn.getalby-assets.com in img-src

* feat(stories): bump avatar size and add ring gap

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(stories): post-review cleanups

- Use react-router Link for in-tab CTA instead of plain <a>.
- Drop redundant www.youtube.com from frame-src (embeds always go through nocookie).
- Tighten stories endpoint status check from >= 300 to >= 400.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(stories): address CodeRabbit feedback

- Switch StoriesWidget to useSWR + swrFetcher (project convention).
- Guard story iframe with isYouTubeUrl so non-YouTube urls never embed.
- Wrap GetStories errors with fmt.Errorf("...: %w", err).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(stories): drop isYouTubeUrl guard

Stories are curated and always YouTube; the runtime check was
redundant. CSP frame-src still constrains the iframe source.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(stories): drop getYouTubeEmbedUrl, embed videoUrl as-is

The Alby API now sends canonical youtube-nocookie embed URLs with
autoplay/rel query strings (getAlby/getalby.com#2568), so the
runtime normalization is no longer needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(stories): use w-16 instead of arbitrary w-[73px]

Match the avatar's size token; no magic numbers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(stories): take videoId from API and assemble embed url locally

Pairs with getAlby/getalby.com#2568. The API now sends just the
YouTube videoId; the hub composes the canonical embed URL so the
domain/query-string format stays in one place.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(stories): treat 3xx as non-success, matching file convention

The other status checks in alby_oauth_service.go all use >= 300;
align GetStories so redirects don't slip through.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(stories): move viewed-storage key to constants, widen story button

Address review feedback:
- Centralize the localStorage key for viewed stories in localStorageKeys
  alongside the other keys.
- Widen the story button from w-16 to w-20 so "Alby Extension" fits on
  one line and matches the other titles.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(stories): bump story button to w-24 so titles fit one line

w-20 still wrapped "Alby Extension"; w-24 fits all current titles
without truncation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Revert "chore(stories): bump story button to w-24 so titles fit one line"

This reverts commit 0b47438f50.

* chore(stories): split title words onto separate lines

Reserve two lines for every story title so avatars align regardless of
title length.

* chore(stories): align homeStoriesViewed key with sibling pattern

* chore(stories): fit titles on one line

* chore(stories): widen story button to w-21 for one-line titles

---------

Co-authored-by: René Aaron <rene@twentyuno.net>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-06-02 10:50:15 +02:00

1092 lines
35 KiB
Go

// Code generated by mockery; DO NOT EDIT.
// github.com/vektra/mockery
// template: testify
package mocks
import (
"context"
"github.com/getAlby/hub/alby"
"github.com/getAlby/hub/events"
"github.com/getAlby/hub/lnclient"
mock "github.com/stretchr/testify/mock"
)
// NewMockAlbyOAuthService creates a new instance of MockAlbyOAuthService. 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 NewMockAlbyOAuthService(t interface {
mock.TestingT
Cleanup(func())
}) *MockAlbyOAuthService {
mock := &MockAlbyOAuthService{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
// MockAlbyOAuthService is an autogenerated mock type for the AlbyOAuthService type
type MockAlbyOAuthService struct {
mock.Mock
}
type MockAlbyOAuthService_Expecter struct {
mock *mock.Mock
}
func (_m *MockAlbyOAuthService) EXPECT() *MockAlbyOAuthService_Expecter {
return &MockAlbyOAuthService_Expecter{mock: &_m.Mock}
}
// CallbackHandler provides a mock function for the type MockAlbyOAuthService
func (_mock *MockAlbyOAuthService) CallbackHandler(ctx context.Context, code string) error {
ret := _mock.Called(ctx, code)
if len(ret) == 0 {
panic("no return value specified for CallbackHandler")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = returnFunc(ctx, code)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockAlbyOAuthService_CallbackHandler_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CallbackHandler'
type MockAlbyOAuthService_CallbackHandler_Call struct {
*mock.Call
}
// CallbackHandler is a helper method to define mock.On call
// - ctx context.Context
// - code string
func (_e *MockAlbyOAuthService_Expecter) CallbackHandler(ctx interface{}, code interface{}) *MockAlbyOAuthService_CallbackHandler_Call {
return &MockAlbyOAuthService_CallbackHandler_Call{Call: _e.mock.On("CallbackHandler", ctx, code)}
}
func (_c *MockAlbyOAuthService_CallbackHandler_Call) Run(run func(ctx context.Context, code string)) *MockAlbyOAuthService_CallbackHandler_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockAlbyOAuthService_CallbackHandler_Call) Return(err error) *MockAlbyOAuthService_CallbackHandler_Call {
_c.Call.Return(err)
return _c
}
func (_c *MockAlbyOAuthService_CallbackHandler_Call) RunAndReturn(run func(ctx context.Context, code string) error) *MockAlbyOAuthService_CallbackHandler_Call {
_c.Call.Return(run)
return _c
}
// ConsumeEvent provides a mock function for the type MockAlbyOAuthService
func (_mock *MockAlbyOAuthService) ConsumeEvent(ctx context.Context, event *events.Event, globalProperties map[string]interface{}) {
_mock.Called(ctx, event, globalProperties)
return
}
// MockAlbyOAuthService_ConsumeEvent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ConsumeEvent'
type MockAlbyOAuthService_ConsumeEvent_Call struct {
*mock.Call
}
// ConsumeEvent is a helper method to define mock.On call
// - ctx context.Context
// - event *events.Event
// - globalProperties map[string]interface{}
func (_e *MockAlbyOAuthService_Expecter) ConsumeEvent(ctx interface{}, event interface{}, globalProperties interface{}) *MockAlbyOAuthService_ConsumeEvent_Call {
return &MockAlbyOAuthService_ConsumeEvent_Call{Call: _e.mock.On("ConsumeEvent", ctx, event, globalProperties)}
}
func (_c *MockAlbyOAuthService_ConsumeEvent_Call) Run(run func(ctx context.Context, event *events.Event, globalProperties map[string]interface{})) *MockAlbyOAuthService_ConsumeEvent_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 *events.Event
if args[1] != nil {
arg1 = args[1].(*events.Event)
}
var arg2 map[string]interface{}
if args[2] != nil {
arg2 = args[2].(map[string]interface{})
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *MockAlbyOAuthService_ConsumeEvent_Call) Return() *MockAlbyOAuthService_ConsumeEvent_Call {
_c.Call.Return()
return _c
}
func (_c *MockAlbyOAuthService_ConsumeEvent_Call) RunAndReturn(run func(ctx context.Context, event *events.Event, globalProperties map[string]interface{})) *MockAlbyOAuthService_ConsumeEvent_Call {
_c.Run(run)
return _c
}
// CreateLSPOrder provides a mock function for the type MockAlbyOAuthService
func (_mock *MockAlbyOAuthService) CreateLSPOrder(ctx context.Context, lsp string, network string, lspChannelRequest *alby.LSPChannelRequest) (*alby.LSPChannelResponse, error) {
ret := _mock.Called(ctx, lsp, network, lspChannelRequest)
if len(ret) == 0 {
panic("no return value specified for CreateLSPOrder")
}
var r0 *alby.LSPChannelResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *alby.LSPChannelRequest) (*alby.LSPChannelResponse, error)); ok {
return returnFunc(ctx, lsp, network, lspChannelRequest)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *alby.LSPChannelRequest) *alby.LSPChannelResponse); ok {
r0 = returnFunc(ctx, lsp, network, lspChannelRequest)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*alby.LSPChannelResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, *alby.LSPChannelRequest) error); ok {
r1 = returnFunc(ctx, lsp, network, lspChannelRequest)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockAlbyOAuthService_CreateLSPOrder_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateLSPOrder'
type MockAlbyOAuthService_CreateLSPOrder_Call struct {
*mock.Call
}
// CreateLSPOrder is a helper method to define mock.On call
// - ctx context.Context
// - lsp string
// - network string
// - lspChannelRequest *alby.LSPChannelRequest
func (_e *MockAlbyOAuthService_Expecter) CreateLSPOrder(ctx interface{}, lsp interface{}, network interface{}, lspChannelRequest interface{}) *MockAlbyOAuthService_CreateLSPOrder_Call {
return &MockAlbyOAuthService_CreateLSPOrder_Call{Call: _e.mock.On("CreateLSPOrder", ctx, lsp, network, lspChannelRequest)}
}
func (_c *MockAlbyOAuthService_CreateLSPOrder_Call) Run(run func(ctx context.Context, lsp string, network string, lspChannelRequest *alby.LSPChannelRequest)) *MockAlbyOAuthService_CreateLSPOrder_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
var arg2 string
if args[2] != nil {
arg2 = args[2].(string)
}
var arg3 *alby.LSPChannelRequest
if args[3] != nil {
arg3 = args[3].(*alby.LSPChannelRequest)
}
run(
arg0,
arg1,
arg2,
arg3,
)
})
return _c
}
func (_c *MockAlbyOAuthService_CreateLSPOrder_Call) Return(lSPChannelResponse *alby.LSPChannelResponse, err error) *MockAlbyOAuthService_CreateLSPOrder_Call {
_c.Call.Return(lSPChannelResponse, err)
return _c
}
func (_c *MockAlbyOAuthService_CreateLSPOrder_Call) RunAndReturn(run func(ctx context.Context, lsp string, network string, lspChannelRequest *alby.LSPChannelRequest) (*alby.LSPChannelResponse, error)) *MockAlbyOAuthService_CreateLSPOrder_Call {
_c.Call.Return(run)
return _c
}
// CreateLightningAddress provides a mock function for the type MockAlbyOAuthService
func (_mock *MockAlbyOAuthService) CreateLightningAddress(ctx context.Context, address string, appId uint) (*alby.CreateLightningAddressResponse, error) {
ret := _mock.Called(ctx, address, appId)
if len(ret) == 0 {
panic("no return value specified for CreateLightningAddress")
}
var r0 *alby.CreateLightningAddressResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string, uint) (*alby.CreateLightningAddressResponse, error)); ok {
return returnFunc(ctx, address, appId)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, string, uint) *alby.CreateLightningAddressResponse); ok {
r0 = returnFunc(ctx, address, appId)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*alby.CreateLightningAddressResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, string, uint) error); ok {
r1 = returnFunc(ctx, address, appId)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockAlbyOAuthService_CreateLightningAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateLightningAddress'
type MockAlbyOAuthService_CreateLightningAddress_Call struct {
*mock.Call
}
// CreateLightningAddress is a helper method to define mock.On call
// - ctx context.Context
// - address string
// - appId uint
func (_e *MockAlbyOAuthService_Expecter) CreateLightningAddress(ctx interface{}, address interface{}, appId interface{}) *MockAlbyOAuthService_CreateLightningAddress_Call {
return &MockAlbyOAuthService_CreateLightningAddress_Call{Call: _e.mock.On("CreateLightningAddress", ctx, address, appId)}
}
func (_c *MockAlbyOAuthService_CreateLightningAddress_Call) Run(run func(ctx context.Context, address string, appId uint)) *MockAlbyOAuthService_CreateLightningAddress_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
var arg2 uint
if args[2] != nil {
arg2 = args[2].(uint)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *MockAlbyOAuthService_CreateLightningAddress_Call) Return(createLightningAddressResponse *alby.CreateLightningAddressResponse, err error) *MockAlbyOAuthService_CreateLightningAddress_Call {
_c.Call.Return(createLightningAddressResponse, err)
return _c
}
func (_c *MockAlbyOAuthService_CreateLightningAddress_Call) RunAndReturn(run func(ctx context.Context, address string, appId uint) (*alby.CreateLightningAddressResponse, error)) *MockAlbyOAuthService_CreateLightningAddress_Call {
_c.Call.Return(run)
return _c
}
// DeleteLightningAddress provides a mock function for the type MockAlbyOAuthService
func (_mock *MockAlbyOAuthService) DeleteLightningAddress(ctx context.Context, address string) error {
ret := _mock.Called(ctx, address)
if len(ret) == 0 {
panic("no return value specified for DeleteLightningAddress")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = returnFunc(ctx, address)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockAlbyOAuthService_DeleteLightningAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteLightningAddress'
type MockAlbyOAuthService_DeleteLightningAddress_Call struct {
*mock.Call
}
// DeleteLightningAddress is a helper method to define mock.On call
// - ctx context.Context
// - address string
func (_e *MockAlbyOAuthService_Expecter) DeleteLightningAddress(ctx interface{}, address interface{}) *MockAlbyOAuthService_DeleteLightningAddress_Call {
return &MockAlbyOAuthService_DeleteLightningAddress_Call{Call: _e.mock.On("DeleteLightningAddress", ctx, address)}
}
func (_c *MockAlbyOAuthService_DeleteLightningAddress_Call) Run(run func(ctx context.Context, address string)) *MockAlbyOAuthService_DeleteLightningAddress_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockAlbyOAuthService_DeleteLightningAddress_Call) Return(err error) *MockAlbyOAuthService_DeleteLightningAddress_Call {
_c.Call.Return(err)
return _c
}
func (_c *MockAlbyOAuthService_DeleteLightningAddress_Call) RunAndReturn(run func(ctx context.Context, address string) error) *MockAlbyOAuthService_DeleteLightningAddress_Call {
_c.Call.Return(run)
return _c
}
// GetAuthUrl provides a mock function for the type MockAlbyOAuthService
func (_mock *MockAlbyOAuthService) GetAuthUrl() string {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetAuthUrl")
}
var r0 string
if returnFunc, ok := ret.Get(0).(func() string); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(string)
}
return r0
}
// MockAlbyOAuthService_GetAuthUrl_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAuthUrl'
type MockAlbyOAuthService_GetAuthUrl_Call struct {
*mock.Call
}
// GetAuthUrl is a helper method to define mock.On call
func (_e *MockAlbyOAuthService_Expecter) GetAuthUrl() *MockAlbyOAuthService_GetAuthUrl_Call {
return &MockAlbyOAuthService_GetAuthUrl_Call{Call: _e.mock.On("GetAuthUrl")}
}
func (_c *MockAlbyOAuthService_GetAuthUrl_Call) Run(run func()) *MockAlbyOAuthService_GetAuthUrl_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockAlbyOAuthService_GetAuthUrl_Call) Return(s string) *MockAlbyOAuthService_GetAuthUrl_Call {
_c.Call.Return(s)
return _c
}
func (_c *MockAlbyOAuthService_GetAuthUrl_Call) RunAndReturn(run func() string) *MockAlbyOAuthService_GetAuthUrl_Call {
_c.Call.Return(run)
return _c
}
// GetLSPChannelOffer provides a mock function for the type MockAlbyOAuthService
func (_mock *MockAlbyOAuthService) GetLSPChannelOffer(ctx context.Context) (*alby.LSPChannelOffer, error) {
ret := _mock.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for GetLSPChannelOffer")
}
var r0 *alby.LSPChannelOffer
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context) (*alby.LSPChannelOffer, error)); ok {
return returnFunc(ctx)
}
if returnFunc, ok := ret.Get(0).(func(context.Context) *alby.LSPChannelOffer); ok {
r0 = returnFunc(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*alby.LSPChannelOffer)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = returnFunc(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockAlbyOAuthService_GetLSPChannelOffer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLSPChannelOffer'
type MockAlbyOAuthService_GetLSPChannelOffer_Call struct {
*mock.Call
}
// GetLSPChannelOffer is a helper method to define mock.On call
// - ctx context.Context
func (_e *MockAlbyOAuthService_Expecter) GetLSPChannelOffer(ctx interface{}) *MockAlbyOAuthService_GetLSPChannelOffer_Call {
return &MockAlbyOAuthService_GetLSPChannelOffer_Call{Call: _e.mock.On("GetLSPChannelOffer", ctx)}
}
func (_c *MockAlbyOAuthService_GetLSPChannelOffer_Call) Run(run func(ctx context.Context)) *MockAlbyOAuthService_GetLSPChannelOffer_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
run(
arg0,
)
})
return _c
}
func (_c *MockAlbyOAuthService_GetLSPChannelOffer_Call) Return(lSPChannelOffer *alby.LSPChannelOffer, err error) *MockAlbyOAuthService_GetLSPChannelOffer_Call {
_c.Call.Return(lSPChannelOffer, err)
return _c
}
func (_c *MockAlbyOAuthService_GetLSPChannelOffer_Call) RunAndReturn(run func(ctx context.Context) (*alby.LSPChannelOffer, error)) *MockAlbyOAuthService_GetLSPChannelOffer_Call {
_c.Call.Return(run)
return _c
}
// GetLSPInfo provides a mock function for the type MockAlbyOAuthService
func (_mock *MockAlbyOAuthService) GetLSPInfo(ctx context.Context, lsp string, network string) (*alby.LSPInfo, error) {
ret := _mock.Called(ctx, lsp, network)
if len(ret) == 0 {
panic("no return value specified for GetLSPInfo")
}
var r0 *alby.LSPInfo
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*alby.LSPInfo, error)); ok {
return returnFunc(ctx, lsp, network)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *alby.LSPInfo); ok {
r0 = returnFunc(ctx, lsp, network)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*alby.LSPInfo)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok {
r1 = returnFunc(ctx, lsp, network)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockAlbyOAuthService_GetLSPInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLSPInfo'
type MockAlbyOAuthService_GetLSPInfo_Call struct {
*mock.Call
}
// GetLSPInfo is a helper method to define mock.On call
// - ctx context.Context
// - lsp string
// - network string
func (_e *MockAlbyOAuthService_Expecter) GetLSPInfo(ctx interface{}, lsp interface{}, network interface{}) *MockAlbyOAuthService_GetLSPInfo_Call {
return &MockAlbyOAuthService_GetLSPInfo_Call{Call: _e.mock.On("GetLSPInfo", ctx, lsp, network)}
}
func (_c *MockAlbyOAuthService_GetLSPInfo_Call) Run(run func(ctx context.Context, lsp string, network string)) *MockAlbyOAuthService_GetLSPInfo_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
var arg2 string
if args[2] != nil {
arg2 = args[2].(string)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *MockAlbyOAuthService_GetLSPInfo_Call) Return(lSPInfo *alby.LSPInfo, err error) *MockAlbyOAuthService_GetLSPInfo_Call {
_c.Call.Return(lSPInfo, err)
return _c
}
func (_c *MockAlbyOAuthService_GetLSPInfo_Call) RunAndReturn(run func(ctx context.Context, lsp string, network string) (*alby.LSPInfo, error)) *MockAlbyOAuthService_GetLSPInfo_Call {
_c.Call.Return(run)
return _c
}
// GetLightningAddress provides a mock function for the type MockAlbyOAuthService
func (_mock *MockAlbyOAuthService) GetLightningAddress() (string, error) {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetLightningAddress")
}
var r0 string
var r1 error
if returnFunc, ok := ret.Get(0).(func() (string, error)); ok {
return returnFunc()
}
if returnFunc, ok := ret.Get(0).(func() string); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(string)
}
if returnFunc, ok := ret.Get(1).(func() error); ok {
r1 = returnFunc()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockAlbyOAuthService_GetLightningAddress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLightningAddress'
type MockAlbyOAuthService_GetLightningAddress_Call struct {
*mock.Call
}
// GetLightningAddress is a helper method to define mock.On call
func (_e *MockAlbyOAuthService_Expecter) GetLightningAddress() *MockAlbyOAuthService_GetLightningAddress_Call {
return &MockAlbyOAuthService_GetLightningAddress_Call{Call: _e.mock.On("GetLightningAddress")}
}
func (_c *MockAlbyOAuthService_GetLightningAddress_Call) Run(run func()) *MockAlbyOAuthService_GetLightningAddress_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockAlbyOAuthService_GetLightningAddress_Call) Return(s string, err error) *MockAlbyOAuthService_GetLightningAddress_Call {
_c.Call.Return(s, err)
return _c
}
func (_c *MockAlbyOAuthService_GetLightningAddress_Call) RunAndReturn(run func() (string, error)) *MockAlbyOAuthService_GetLightningAddress_Call {
_c.Call.Return(run)
return _c
}
// GetMe provides a mock function for the type MockAlbyOAuthService
func (_mock *MockAlbyOAuthService) GetMe(ctx context.Context) (*alby.AlbyMe, error) {
ret := _mock.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for GetMe")
}
var r0 *alby.AlbyMe
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context) (*alby.AlbyMe, error)); ok {
return returnFunc(ctx)
}
if returnFunc, ok := ret.Get(0).(func(context.Context) *alby.AlbyMe); ok {
r0 = returnFunc(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*alby.AlbyMe)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = returnFunc(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockAlbyOAuthService_GetMe_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetMe'
type MockAlbyOAuthService_GetMe_Call struct {
*mock.Call
}
// GetMe is a helper method to define mock.On call
// - ctx context.Context
func (_e *MockAlbyOAuthService_Expecter) GetMe(ctx interface{}) *MockAlbyOAuthService_GetMe_Call {
return &MockAlbyOAuthService_GetMe_Call{Call: _e.mock.On("GetMe", ctx)}
}
func (_c *MockAlbyOAuthService_GetMe_Call) Run(run func(ctx context.Context)) *MockAlbyOAuthService_GetMe_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
run(
arg0,
)
})
return _c
}
func (_c *MockAlbyOAuthService_GetMe_Call) Return(albyMe *alby.AlbyMe, err error) *MockAlbyOAuthService_GetMe_Call {
_c.Call.Return(albyMe, err)
return _c
}
func (_c *MockAlbyOAuthService_GetMe_Call) RunAndReturn(run func(ctx context.Context) (*alby.AlbyMe, error)) *MockAlbyOAuthService_GetMe_Call {
_c.Call.Return(run)
return _c
}
// GetStories provides a mock function for the type MockAlbyOAuthService
func (_mock *MockAlbyOAuthService) GetStories(ctx context.Context) ([]alby.Story, error) {
ret := _mock.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for GetStories")
}
var r0 []alby.Story
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context) ([]alby.Story, error)); ok {
return returnFunc(ctx)
}
if returnFunc, ok := ret.Get(0).(func(context.Context) []alby.Story); ok {
r0 = returnFunc(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]alby.Story)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = returnFunc(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetUserIdentifier provides a mock function for the type MockAlbyOAuthService
func (_mock *MockAlbyOAuthService) GetUserIdentifier() (string, error) {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for GetUserIdentifier")
}
var r0 string
var r1 error
if returnFunc, ok := ret.Get(0).(func() (string, error)); ok {
return returnFunc()
}
if returnFunc, ok := ret.Get(0).(func() string); ok {
r0 = returnFunc()
} else {
r0 = ret.Get(0).(string)
}
if returnFunc, ok := ret.Get(1).(func() error); ok {
r1 = returnFunc()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockAlbyOAuthService_GetUserIdentifier_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserIdentifier'
type MockAlbyOAuthService_GetUserIdentifier_Call struct {
*mock.Call
}
// GetUserIdentifier is a helper method to define mock.On call
func (_e *MockAlbyOAuthService_Expecter) GetUserIdentifier() *MockAlbyOAuthService_GetUserIdentifier_Call {
return &MockAlbyOAuthService_GetUserIdentifier_Call{Call: _e.mock.On("GetUserIdentifier")}
}
func (_c *MockAlbyOAuthService_GetUserIdentifier_Call) Run(run func()) *MockAlbyOAuthService_GetUserIdentifier_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockAlbyOAuthService_GetUserIdentifier_Call) Return(s string, err error) *MockAlbyOAuthService_GetUserIdentifier_Call {
_c.Call.Return(s, err)
return _c
}
func (_c *MockAlbyOAuthService_GetUserIdentifier_Call) RunAndReturn(run func() (string, error)) *MockAlbyOAuthService_GetUserIdentifier_Call {
_c.Call.Return(run)
return _c
}
// GetVssAuthToken provides a mock function for the type MockAlbyOAuthService
func (_mock *MockAlbyOAuthService) GetVssAuthToken(ctx context.Context, nodeIdentifier string) (string, error) {
ret := _mock.Called(ctx, nodeIdentifier)
if len(ret) == 0 {
panic("no return value specified for GetVssAuthToken")
}
var r0 string
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, string) (string, error)); ok {
return returnFunc(ctx, nodeIdentifier)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, string) string); ok {
r0 = returnFunc(ctx, nodeIdentifier)
} else {
r0 = ret.Get(0).(string)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = returnFunc(ctx, nodeIdentifier)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockAlbyOAuthService_GetVssAuthToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetVssAuthToken'
type MockAlbyOAuthService_GetVssAuthToken_Call struct {
*mock.Call
}
// GetVssAuthToken is a helper method to define mock.On call
// - ctx context.Context
// - nodeIdentifier string
func (_e *MockAlbyOAuthService_Expecter) GetVssAuthToken(ctx interface{}, nodeIdentifier interface{}) *MockAlbyOAuthService_GetVssAuthToken_Call {
return &MockAlbyOAuthService_GetVssAuthToken_Call{Call: _e.mock.On("GetVssAuthToken", ctx, nodeIdentifier)}
}
func (_c *MockAlbyOAuthService_GetVssAuthToken_Call) Run(run func(ctx context.Context, nodeIdentifier string)) *MockAlbyOAuthService_GetVssAuthToken_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 string
if args[1] != nil {
arg1 = args[1].(string)
}
run(
arg0,
arg1,
)
})
return _c
}
func (_c *MockAlbyOAuthService_GetVssAuthToken_Call) Return(s string, err error) *MockAlbyOAuthService_GetVssAuthToken_Call {
_c.Call.Return(s, err)
return _c
}
func (_c *MockAlbyOAuthService_GetVssAuthToken_Call) RunAndReturn(run func(ctx context.Context, nodeIdentifier string) (string, error)) *MockAlbyOAuthService_GetVssAuthToken_Call {
_c.Call.Return(run)
return _c
}
// IsConnected provides a mock function for the type MockAlbyOAuthService
func (_mock *MockAlbyOAuthService) IsConnected(ctx context.Context) bool {
ret := _mock.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for IsConnected")
}
var r0 bool
if returnFunc, ok := ret.Get(0).(func(context.Context) bool); ok {
r0 = returnFunc(ctx)
} else {
r0 = ret.Get(0).(bool)
}
return r0
}
// MockAlbyOAuthService_IsConnected_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'IsConnected'
type MockAlbyOAuthService_IsConnected_Call struct {
*mock.Call
}
// IsConnected is a helper method to define mock.On call
// - ctx context.Context
func (_e *MockAlbyOAuthService_Expecter) IsConnected(ctx interface{}) *MockAlbyOAuthService_IsConnected_Call {
return &MockAlbyOAuthService_IsConnected_Call{Call: _e.mock.On("IsConnected", ctx)}
}
func (_c *MockAlbyOAuthService_IsConnected_Call) Run(run func(ctx context.Context)) *MockAlbyOAuthService_IsConnected_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
run(
arg0,
)
})
return _c
}
func (_c *MockAlbyOAuthService_IsConnected_Call) Return(b bool) *MockAlbyOAuthService_IsConnected_Call {
_c.Call.Return(b)
return _c
}
func (_c *MockAlbyOAuthService_IsConnected_Call) RunAndReturn(run func(ctx context.Context) bool) *MockAlbyOAuthService_IsConnected_Call {
_c.Call.Return(run)
return _c
}
// LinkAccount provides a mock function for the type MockAlbyOAuthService
func (_mock *MockAlbyOAuthService) LinkAccount(ctx context.Context, lnClient lnclient.LNClient, budgetSat uint64, renewal string) error {
ret := _mock.Called(ctx, lnClient, budgetSat, renewal)
if len(ret) == 0 {
panic("no return value specified for LinkAccount")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context, lnclient.LNClient, uint64, string) error); ok {
r0 = returnFunc(ctx, lnClient, budgetSat, renewal)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockAlbyOAuthService_LinkAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LinkAccount'
type MockAlbyOAuthService_LinkAccount_Call struct {
*mock.Call
}
// LinkAccount is a helper method to define mock.On call
// - ctx context.Context
// - lnClient lnclient.LNClient
// - budgetSat uint64
// - renewal string
func (_e *MockAlbyOAuthService_Expecter) LinkAccount(ctx interface{}, lnClient interface{}, budgetSat interface{}, renewal interface{}) *MockAlbyOAuthService_LinkAccount_Call {
return &MockAlbyOAuthService_LinkAccount_Call{Call: _e.mock.On("LinkAccount", ctx, lnClient, budgetSat, renewal)}
}
func (_c *MockAlbyOAuthService_LinkAccount_Call) Run(run func(ctx context.Context, lnClient lnclient.LNClient, budgetSat uint64, renewal string)) *MockAlbyOAuthService_LinkAccount_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 lnclient.LNClient
if args[1] != nil {
arg1 = args[1].(lnclient.LNClient)
}
var arg2 uint64
if args[2] != nil {
arg2 = args[2].(uint64)
}
var arg3 string
if args[3] != nil {
arg3 = args[3].(string)
}
run(
arg0,
arg1,
arg2,
arg3,
)
})
return _c
}
func (_c *MockAlbyOAuthService_LinkAccount_Call) Return(err error) *MockAlbyOAuthService_LinkAccount_Call {
_c.Call.Return(err)
return _c
}
func (_c *MockAlbyOAuthService_LinkAccount_Call) RunAndReturn(run func(ctx context.Context, lnClient lnclient.LNClient, budgetSat uint64, renewal string) error) *MockAlbyOAuthService_LinkAccount_Call {
_c.Call.Return(run)
return _c
}
// RemoveOAuthAccessToken provides a mock function for the type MockAlbyOAuthService
func (_mock *MockAlbyOAuthService) RemoveOAuthAccessToken() error {
ret := _mock.Called()
if len(ret) == 0 {
panic("no return value specified for RemoveOAuthAccessToken")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func() error); ok {
r0 = returnFunc()
} else {
r0 = ret.Error(0)
}
return r0
}
// MockAlbyOAuthService_RemoveOAuthAccessToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveOAuthAccessToken'
type MockAlbyOAuthService_RemoveOAuthAccessToken_Call struct {
*mock.Call
}
// RemoveOAuthAccessToken is a helper method to define mock.On call
func (_e *MockAlbyOAuthService_Expecter) RemoveOAuthAccessToken() *MockAlbyOAuthService_RemoveOAuthAccessToken_Call {
return &MockAlbyOAuthService_RemoveOAuthAccessToken_Call{Call: _e.mock.On("RemoveOAuthAccessToken")}
}
func (_c *MockAlbyOAuthService_RemoveOAuthAccessToken_Call) Run(run func()) *MockAlbyOAuthService_RemoveOAuthAccessToken_Call {
_c.Call.Run(func(args mock.Arguments) {
run()
})
return _c
}
func (_c *MockAlbyOAuthService_RemoveOAuthAccessToken_Call) Return(err error) *MockAlbyOAuthService_RemoveOAuthAccessToken_Call {
_c.Call.Return(err)
return _c
}
func (_c *MockAlbyOAuthService_RemoveOAuthAccessToken_Call) RunAndReturn(run func() error) *MockAlbyOAuthService_RemoveOAuthAccessToken_Call {
_c.Call.Return(run)
return _c
}
// RequestAutoChannel provides a mock function for the type MockAlbyOAuthService
func (_mock *MockAlbyOAuthService) RequestAutoChannel(ctx context.Context, lnClient lnclient.LNClient, isPublic bool) (*alby.AutoChannelResponse, error) {
ret := _mock.Called(ctx, lnClient, isPublic)
if len(ret) == 0 {
panic("no return value specified for RequestAutoChannel")
}
var r0 *alby.AutoChannelResponse
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, lnclient.LNClient, bool) (*alby.AutoChannelResponse, error)); ok {
return returnFunc(ctx, lnClient, isPublic)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, lnclient.LNClient, bool) *alby.AutoChannelResponse); ok {
r0 = returnFunc(ctx, lnClient, isPublic)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*alby.AutoChannelResponse)
}
}
if returnFunc, ok := ret.Get(1).(func(context.Context, lnclient.LNClient, bool) error); ok {
r1 = returnFunc(ctx, lnClient, isPublic)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockAlbyOAuthService_RequestAutoChannel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RequestAutoChannel'
type MockAlbyOAuthService_RequestAutoChannel_Call struct {
*mock.Call
}
// RequestAutoChannel is a helper method to define mock.On call
// - ctx context.Context
// - lnClient lnclient.LNClient
// - isPublic bool
func (_e *MockAlbyOAuthService_Expecter) RequestAutoChannel(ctx interface{}, lnClient interface{}, isPublic interface{}) *MockAlbyOAuthService_RequestAutoChannel_Call {
return &MockAlbyOAuthService_RequestAutoChannel_Call{Call: _e.mock.On("RequestAutoChannel", ctx, lnClient, isPublic)}
}
func (_c *MockAlbyOAuthService_RequestAutoChannel_Call) Run(run func(ctx context.Context, lnClient lnclient.LNClient, isPublic bool)) *MockAlbyOAuthService_RequestAutoChannel_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 lnclient.LNClient
if args[1] != nil {
arg1 = args[1].(lnclient.LNClient)
}
var arg2 bool
if args[2] != nil {
arg2 = args[2].(bool)
}
run(
arg0,
arg1,
arg2,
)
})
return _c
}
func (_c *MockAlbyOAuthService_RequestAutoChannel_Call) Return(autoChannelResponse *alby.AutoChannelResponse, err error) *MockAlbyOAuthService_RequestAutoChannel_Call {
_c.Call.Return(autoChannelResponse, err)
return _c
}
func (_c *MockAlbyOAuthService_RequestAutoChannel_Call) RunAndReturn(run func(ctx context.Context, lnClient lnclient.LNClient, isPublic bool) (*alby.AutoChannelResponse, error)) *MockAlbyOAuthService_RequestAutoChannel_Call {
_c.Call.Return(run)
return _c
}
// UnlinkAccount provides a mock function for the type MockAlbyOAuthService
func (_mock *MockAlbyOAuthService) UnlinkAccount(ctx context.Context) error {
ret := _mock.Called(ctx)
if len(ret) == 0 {
panic("no return value specified for UnlinkAccount")
}
var r0 error
if returnFunc, ok := ret.Get(0).(func(context.Context) error); ok {
r0 = returnFunc(ctx)
} else {
r0 = ret.Error(0)
}
return r0
}
// MockAlbyOAuthService_UnlinkAccount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnlinkAccount'
type MockAlbyOAuthService_UnlinkAccount_Call struct {
*mock.Call
}
// UnlinkAccount is a helper method to define mock.On call
// - ctx context.Context
func (_e *MockAlbyOAuthService_Expecter) UnlinkAccount(ctx interface{}) *MockAlbyOAuthService_UnlinkAccount_Call {
return &MockAlbyOAuthService_UnlinkAccount_Call{Call: _e.mock.On("UnlinkAccount", ctx)}
}
func (_c *MockAlbyOAuthService_UnlinkAccount_Call) Run(run func(ctx context.Context)) *MockAlbyOAuthService_UnlinkAccount_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
run(
arg0,
)
})
return _c
}
func (_c *MockAlbyOAuthService_UnlinkAccount_Call) Return(err error) *MockAlbyOAuthService_UnlinkAccount_Call {
_c.Call.Return(err)
return _c
}
func (_c *MockAlbyOAuthService_UnlinkAccount_Call) RunAndReturn(run func(ctx context.Context) error) *MockAlbyOAuthService_UnlinkAccount_Call {
_c.Call.Return(run)
return _c
}