summaryrefslogtreecommitdiff
path: root/internal/service/mock.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/service/mock.go')
-rw-r--r--internal/service/mock.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/service/mock.go b/internal/service/mock.go
index f174a62..c6c2301 100644
--- a/internal/service/mock.go
+++ b/internal/service/mock.go
@@ -18,6 +18,7 @@ var (
_ MediaFavoriteService = (*MockMediaService)(nil)
_ MediaNoteService = (*MockMediaService)(nil)
_ MediaService = (*MockMediaService)(nil)
+ _ AuthService = (*MockAuthService)(nil)
)
// MockMediaService is a fake MediaService for testing.
@@ -240,6 +241,25 @@ func (m *MockAdminService) RevokePermission(ctx context.Context, setID, userID i
return nil
}
+// MockAuthService is a fake AuthService for testing.
+type MockAuthService struct {
+ BootstrapFunc func(ctx context.Context, username, password string) (*AuthResult, error)
+ LoginFunc func(ctx context.Context, username, password string) (*AuthResult, error)
+}
+
+func (m *MockAuthService) Bootstrap(ctx context.Context, username, password string) (*AuthResult, error) {
+ if m.BootstrapFunc != nil {
+ return m.BootstrapFunc(ctx, username, password)
+ }
+ return nil, nil
+}
+func (m *MockAuthService) Login(ctx context.Context, username, password string) (*AuthResult, error) {
+ if m.LoginFunc != nil {
+ return m.LoginFunc(ctx, username, password)
+ }
+ return nil, nil
+}
+
// MockProgressService is a fake ProgressService for testing.
type MockProgressService struct {
UpdateProgressFunc func(ctx context.Context, sessionID string, userID, mediaID int64, position float64) error