Skip to content

Commit 9c6487a

Browse files
committed
fix: correct mock client type and remove deprecated ClusterName field in tests
Signed-off-by: Shreesha001 <shettyshreesha552@gmail.com>
1 parent b7f871e commit 9c6487a

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

service/access_control_service_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ package service
1919
import (
2020
"context"
2121
"fmt"
22+
"testing"
23+
2224
"github.com/kubeslice/kubeslice-controller/metrics"
2325
metricMock "github.com/kubeslice/kubeslice-controller/metrics/mocks"
24-
"testing"
2526

2627
ossEvents "github.com/kubeslice/kubeslice-controller/events"
2728
"github.com/kubeslice/kubeslice-controller/service/mocks"
@@ -1270,7 +1271,7 @@ func ACS_ReconcileWorkerClusterServiceAccountAndRoleBindings(t *testing.T) {
12701271
mMock.AssertExpectations(t)
12711272
}
12721273

1273-
func prepareACSTestContext(ctx context.Context, client util.Client,
1274+
func prepareACSTestContext(ctx context.Context, client *utilMock.Client,
12741275
scheme *runtime.Scheme) context.Context {
12751276
if scheme == nil {
12761277
scheme = runtime.NewScheme()

service/namespace_service_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func TestDeleteNamespace_DoesNothingIfNamespaceDoNotExist(t *testing.T) {
177177
mMock.AssertExpectations(t)
178178
}
179179

180-
func prepareNamespaceTestContext(ctx context.Context, client util.Client, scheme *runtime.Scheme) context.Context {
180+
func prepareNamespaceTestContext(ctx context.Context, client *utilMock.Client, scheme *runtime.Scheme) context.Context {
181181
eventRecorder := events.NewEventRecorder(client, scheme, ossEvents.EventsMap, events.EventRecorderOptions{
182182
Version: "v1alpha1",
183183
Cluster: util.ClusterController,

service/project_service_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ func setupProjectTest(name string, namespace string) (*mocks.INamespaceService,
276276
return nsServiceMock, acsServicemOCK, projectService, requestObj, clientMock, project, ctx, clusterServiceMock, sliceConfigServiceMock, serviceExportConfigServiceMock, sliceQoSConfigServiceMock, mMock
277277
}
278278

279-
func prepareProjectTestContext(ctx context.Context, client util.Client,
279+
func prepareProjectTestContext(ctx context.Context, client *utilMock.Client,
280280
scheme *runtime.Scheme) context.Context {
281281
eventRecorder := events.NewEventRecorder(client, scheme, ossEvents.EventsMap, events.EventRecorderOptions{
282282
Version: "v1alpha1",

service/worker_slice_gateway_service_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,6 @@ func testNodeIpReconciliationOfWorkerSliceGatewaysExists(t *testing.T) {
551551
Annotations: nil,
552552
OwnerReferences: nil,
553553
Finalizers: nil,
554-
ClusterName: "",
555554
ManagedFields: nil,
556555
},
557556
Spec: controllerv1alpha1.ClusterSpec{},

0 commit comments

Comments
 (0)