1
0
forked from baron/baron-sso

AuditRepository 인터페이스 변경에 맞춰 mock 메서드 추가

This commit is contained in:
2026-03-03 14:51:41 +09:00
parent 7cf07a5627
commit 11a06fa94d
2 changed files with 19 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ import (
"encoding/json" "encoding/json"
"io" "io"
"net/http" "net/http"
"time"
) )
// --- Mock IDP Provider --- // --- Mock IDP Provider ---
@@ -101,6 +102,15 @@ func (m *mockAuditRepo) FindByUserAndEvents(ctx context.Context, userID string,
} }
return results, nil return results, nil
} }
func (m *mockAuditRepo) CountFailuresSince(ctx context.Context, since time.Time, tenantID string) (int64, error) {
return 0, nil
}
func (m *mockAuditRepo) CountActiveSessionsSince(ctx context.Context, since time.Time, tenantID string) (int64, error) {
return 0, nil
}
func (m *mockAuditRepo) Ping(ctx context.Context) error { return nil } func (m *mockAuditRepo) Ping(ctx context.Context) error { return nil }
// --- Mock Consent Repository --- // --- Mock Consent Repository ---

View File

@@ -8,6 +8,7 @@ import (
"net/http/httptest" "net/http/httptest"
"strings" "strings"
"testing" "testing"
"time"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
@@ -34,6 +35,14 @@ func (m *MockAuditRepository) FindByUserAndEvents(ctx context.Context, userID st
return args.Get(0).([]domain.AuditLog), args.Error(1) return args.Get(0).([]domain.AuditLog), args.Error(1)
} }
func (m *MockAuditRepository) CountFailuresSince(ctx context.Context, since time.Time, tenantID string) (int64, error) {
return 0, nil
}
func (m *MockAuditRepository) CountActiveSessionsSince(ctx context.Context, since time.Time, tenantID string) (int64, error) {
return 0, nil
}
func (m *MockAuditRepository) Ping(ctx context.Context) error { func (m *MockAuditRepository) Ping(ctx context.Context) error {
args := m.Called(ctx) args := m.Called(ctx)
return args.Error(0) return args.Error(0)