diff --git a/pkg/groups/service_test.go b/pkg/groups/service_test.go index 13c0582b6..4fee92cc2 100644 --- a/pkg/groups/service_test.go +++ b/pkg/groups/service_test.go @@ -29,9 +29,9 @@ import ( //go:generate mockgen -build_flags=--mod=mod -package groups -destination ./mock_interfaces.go -source=./interfaces.go //go:generate mockgen -build_flags=--mod=mod -package groups -destination ./mock_monitor.go -source=../../internal/monitoring/interfaces.go //go:generate mockgen -build_flags=--mod=mod -package groups -destination ./mock_tracing.go go.opentelemetry.io/otel/trace Tracer -//go:generate mockgen -build_flags=--mod=mod -package pool -destination ../../internal/pool/mock_pool.go -source=../../internal/pool/interfaces.go +//go:generate mockgen -build_flags=--mod=mod -package groups -destination ./mock_pool.go -source=../../internal/pool/interfaces.go -func setupMockSubmit(wp *pool.MockWorkerPoolInterface, resultsChan chan *pool.Result[any]) (*gomock.Call, chan *pool.Result[any]) { +func setupMockSubmit(wp *MockWorkerPoolInterface, resultsChan chan *pool.Result[any]) (*gomock.Call, chan *pool.Result[any]) { key := uuid.New() var internalResultsChannel chan *pool.Result[any] @@ -107,7 +107,7 @@ func TestServiceListGroups(t *testing.T) { mockTracer := NewMockTracer(ctrl) mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) svc := NewService(mockOpenFGA, workerPool, mockTracer, mockMonitor, mockLogger) @@ -178,7 +178,7 @@ func TestServiceListRoles(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) svc := NewService(mockOpenFGA, workerPool, mockTracer, mockMonitor, mockLogger) @@ -297,7 +297,7 @@ func TestServiceListIdentities(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) r := new(client.ClientReadResponse) @@ -382,7 +382,7 @@ func TestServiceAssignRoles(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) svc := NewService(mockOpenFGA, workerPool, mockTracer, mockMonitor, mockLogger) @@ -456,7 +456,7 @@ func TestServiceRemoveRoles(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) svc := NewService(mockOpenFGA, workerPool, mockTracer, mockMonitor, mockLogger) @@ -530,7 +530,7 @@ func TestServiceAssignIdentities(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) svc := NewService(mockOpenFGA, workerPool, mockTracer, mockMonitor, mockLogger) @@ -604,7 +604,7 @@ func TestServiceRemoveIdentities(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) svc := NewService(mockOpenFGA, workerPool, mockTracer, mockMonitor, mockLogger) @@ -700,7 +700,7 @@ func TestServiceGetGroup(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) svc := NewService(mockOpenFGA, workerPool, mockTracer, mockMonitor, mockLogger) @@ -764,7 +764,7 @@ func TestServiceCreateGroup(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) svc := NewService(mockOpenFGA, workerPool, mockTracer, mockMonitor, mockLogger) @@ -834,7 +834,7 @@ func TestServiceDeleteGroup(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) for i := 0; i < 7; i++ { setupMockSubmit(workerPool, nil) } @@ -1008,7 +1008,7 @@ func TestServiceListPermissions(t *testing.T) { mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) mockLogger.EXPECT().Info(gomock.Any()).AnyTimes() - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) for i := 0; i < 6; i++ { setupMockSubmit(workerPool, nil) } @@ -1157,7 +1157,7 @@ func TestServiceAssignPermissions(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) svc := NewService(mockOpenFGA, workerPool, mockTracer, mockMonitor, mockLogger) @@ -1237,7 +1237,7 @@ func TestServiceRemovePermissions(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) svc := NewService(mockOpenFGA, workerPool, mockTracer, mockMonitor, mockLogger) diff --git a/pkg/roles/service_test.go b/pkg/roles/service_test.go index fdde5d4a1..33372f674 100644 --- a/pkg/roles/service_test.go +++ b/pkg/roles/service_test.go @@ -37,7 +37,7 @@ import ( //go:generate mockgen -build_flags=--mod=mod -package roles -destination ./mock_pool.go -source=../../internal/pool/interfaces.go //go:generate mockgen -build_flags=--mod=mod -package roles -destination ./mock_authentication.go -source=../authentication/interfaces.go -func setupMockSubmit(wp *pool.MockWorkerPoolInterface, resultsChan chan *pool.Result[any]) (*gomock.Call, chan *pool.Result[any]) { +func setupMockSubmit(wp *MockWorkerPoolInterface, resultsChan chan *pool.Result[any]) (*gomock.Call, chan *pool.Result[any]) { key := uuid.New() var internalResultsChannel chan *pool.Result[any] @@ -114,7 +114,7 @@ func TestServiceListRoles(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) svc := NewService(mockOpenFGA, workerPool, mockTracer, mockMonitor, mockLogger) @@ -230,7 +230,7 @@ func TestServiceListRoleGroups(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) r := new(client.ClientReadResponse) @@ -337,7 +337,7 @@ func TestServiceGetRole(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) svc := NewService(mockOpenFGA, workerPool, mockTracer, mockMonitor, mockLogger) @@ -400,7 +400,7 @@ func TestServiceCreateRole(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) svc := NewService(mockOpenFGA, workerPool, mockTracer, mockMonitor, mockLogger) @@ -470,7 +470,7 @@ func TestServiceDeleteRole(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) for i := 0; i < 7; i++ { setupMockSubmit(workerPool, nil) } @@ -648,7 +648,7 @@ func TestServiceListPermissions(t *testing.T) { mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) mockLogger.EXPECT().Info(gomock.Any()).AnyTimes() - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) for i := 0; i < 6; i++ { setupMockSubmit(workerPool, nil) } @@ -787,7 +787,7 @@ func TestServiceAssignPermissions(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) svc := NewService(mockOpenFGA, workerPool, mockTracer, mockMonitor, mockLogger) @@ -866,7 +866,7 @@ func TestServiceRemovePermissions(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) svc := NewService(mockOpenFGA, workerPool, mockTracer, mockMonitor, mockLogger) @@ -954,7 +954,7 @@ func TestV1ServiceListRoles(t *testing.T) { mockTracer := NewMockTracer(ctrl) mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) mockProvider := NewMockProviderInterface(ctrl) mockLogger.EXPECT().Error(gomock.Any()).AnyTimes() mockTracer.EXPECT().Start(gomock.Any(), gomock.Any()).AnyTimes().DoAndReturn( @@ -1061,7 +1061,7 @@ func TestV1ServiceCreateRole(t *testing.T) { mockTracer := NewMockTracer(ctrl) mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) setupMockSubmit(workerPool, nil) mockProvider := NewMockProviderInterface(ctrl) @@ -1212,7 +1212,7 @@ func TestV1ServiceGetRole(t *testing.T) { mockTracer := NewMockTracer(ctrl) mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) mockProvider := NewMockProviderInterface(ctrl) mockLogger.EXPECT().Error(gomock.Any()).AnyTimes() mockTracer.EXPECT().Start(gomock.Any(), gomock.Any()).AnyTimes().DoAndReturn( @@ -1276,7 +1276,7 @@ func TestV1ServiceDeleteRole(t *testing.T) { mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) mockProvider := NewMockProviderInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) for i := 0; i < 7; i++ { setupMockSubmit(workerPool, nil) } @@ -1470,7 +1470,7 @@ func TestV1ServiceListPermissions(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) for i := 0; i < 6; i++ { setupMockSubmit(workerPool, nil) } @@ -1642,7 +1642,7 @@ func TestV1ServicePatchRoleEntitlementseAssignPermissions(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) for i := 0; i < 6; i++ { setupMockSubmit(workerPool, nil) } @@ -1753,7 +1753,7 @@ func TestV1ServicePatchRoleEntitlementseRemovesPermissions(t *testing.T) { mockMonitor := monitoring.NewMockMonitorInterface(ctrl) mockOpenFGA := NewMockOpenFGAClientInterface(ctrl) - workerPool := pool.NewMockWorkerPoolInterface(ctrl) + workerPool := NewMockWorkerPoolInterface(ctrl) for i := 0; i < 6; i++ { setupMockSubmit(workerPool, nil) }