forked from baron/baron-sso
린트 적용
This commit is contained in:
@@ -1,14 +1,13 @@
|
|||||||
package repository
|
package repository
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"baron-sso-backend/internal/domain"
|
||||||
"context"
|
"context"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"baron-sso-backend/internal/domain"
|
|
||||||
|
|
||||||
"github.com/testcontainers/testcontainers-go"
|
"github.com/testcontainers/testcontainers-go"
|
||||||
postgres_module "github.com/testcontainers/testcontainers-go/modules/postgres"
|
postgres_module "github.com/testcontainers/testcontainers-go/modules/postgres"
|
||||||
"github.com/testcontainers/testcontainers-go/wait"
|
"github.com/testcontainers/testcontainers-go/wait"
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
package repository
|
package repository
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"baron-sso-backend/internal/domain"
|
||||||
"context"
|
"context"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"baron-sso-backend/internal/domain"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
package repository
|
package repository
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"baron-sso-backend/internal/domain"
|
||||||
"context"
|
"context"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"baron-sso-backend/internal/domain"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -17,9 +17,11 @@ type MockKetoOutboxRepositoryShared struct {
|
|||||||
func (m *MockKetoOutboxRepositoryShared) Create(ctx context.Context, entry *domain.KetoOutbox) error {
|
func (m *MockKetoOutboxRepositoryShared) Create(ctx context.Context, entry *domain.KetoOutbox) error {
|
||||||
return m.Called(ctx, entry).Error(0)
|
return m.Called(ctx, entry).Error(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MockKetoOutboxRepositoryShared) CreateWithTx(tx *gorm.DB, entry *domain.KetoOutbox) error {
|
func (m *MockKetoOutboxRepositoryShared) CreateWithTx(tx *gorm.DB, entry *domain.KetoOutbox) error {
|
||||||
return m.Called(tx, entry).Error(0)
|
return m.Called(tx, entry).Error(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MockKetoOutboxRepositoryShared) FindPending(ctx context.Context, limit int) ([]domain.KetoOutbox, error) {
|
func (m *MockKetoOutboxRepositoryShared) FindPending(ctx context.Context, limit int) ([]domain.KetoOutbox, error) {
|
||||||
args := m.Called(ctx, limit)
|
args := m.Called(ctx, limit)
|
||||||
if args.Get(0) == nil {
|
if args.Get(0) == nil {
|
||||||
@@ -27,9 +29,11 @@ func (m *MockKetoOutboxRepositoryShared) FindPending(ctx context.Context, limit
|
|||||||
}
|
}
|
||||||
return args.Get(0).([]domain.KetoOutbox), args.Error(1)
|
return args.Get(0).([]domain.KetoOutbox), args.Error(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MockKetoOutboxRepositoryShared) UpdateStatus(ctx context.Context, id string, status string, retryCount int, lastError string) error {
|
func (m *MockKetoOutboxRepositoryShared) UpdateStatus(ctx context.Context, id string, status string, retryCount int, lastError string) error {
|
||||||
return m.Called(ctx, id, status, retryCount, lastError).Error(0)
|
return m.Called(ctx, id, status, retryCount, lastError).Error(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MockKetoOutboxRepositoryShared) MarkProcessed(ctx context.Context, id string) error {
|
func (m *MockKetoOutboxRepositoryShared) MarkProcessed(ctx context.Context, id string) error {
|
||||||
return m.Called(ctx, id).Error(0)
|
return m.Called(ctx, id).Error(0)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,4 +112,3 @@ func TestTenantService_ApproveTenant_UserNotFound(t *testing.T) {
|
|||||||
mockUserRepo.AssertExpectations(t)
|
mockUserRepo.AssertExpectations(t)
|
||||||
mockOutbox.AssertNotCalled(t, "Create")
|
mockOutbox.AssertNotCalled(t, "Create")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user