Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes explicit gomock.Eq() matcher calls #1983

Merged
merged 1 commit into from
Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/operator/controllers/muo/muo_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestMUOReconciler(t *testing.T) {
enabled: true,
managed: "true",
mocks: func(md *mock_muo.MockDeployer, cluster *arov1alpha1.Cluster) {
md.EXPECT().CreateOrUpdate(gomock.Any(), gomock.Eq(cluster)).Return(nil)
md.EXPECT().CreateOrUpdate(gomock.Any(), cluster).Return(nil)
md.EXPECT().IsReady(gomock.Any()).Return(true, nil)
},
},
Expand All @@ -48,7 +48,7 @@ func TestMUOReconciler(t *testing.T) {
enabled: true,
managed: "true",
mocks: func(md *mock_muo.MockDeployer, cluster *arov1alpha1.Cluster) {
md.EXPECT().CreateOrUpdate(gomock.Any(), gomock.Eq(cluster)).Return(nil)
md.EXPECT().CreateOrUpdate(gomock.Any(), cluster).Return(nil)
md.EXPECT().IsReady(gomock.Any()).Return(false, nil)
},
wantErr: "Managed Upgrade Operator deployment timed out on Ready: timed out waiting for the condition",
Expand All @@ -58,7 +58,7 @@ func TestMUOReconciler(t *testing.T) {
enabled: true,
managed: "true",
mocks: func(md *mock_muo.MockDeployer, cluster *arov1alpha1.Cluster) {
md.EXPECT().CreateOrUpdate(gomock.Any(), gomock.Eq(cluster)).Return(errors.New("failed ensure"))
md.EXPECT().CreateOrUpdate(gomock.Any(), cluster).Return(errors.New("failed ensure"))
},
wantErr: "failed ensure",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func TestReconcileManager(t *testing.T) {
}

storage.EXPECT().GetProperties(gomock.Any(), clusterResourceGroupName, clusterStorageAccountName, gomock.Any()).Return(*result, nil)
storage.EXPECT().Update(gomock.Any(), clusterResourceGroupName, clusterStorageAccountName, gomock.Eq(updated))
storage.EXPECT().Update(gomock.Any(), clusterResourceGroupName, clusterStorageAccountName, updated)

// we can't reuse these from above due to fact how gomock handles objects.
// they are modified by the functions so they are not the same anymore
Expand All @@ -193,7 +193,7 @@ func TestReconcileManager(t *testing.T) {
}

storage.EXPECT().GetProperties(gomock.Any(), clusterResourceGroupName, registryStorageAccountName, gomock.Any()).Return(*result, nil)
storage.EXPECT().Update(gomock.Any(), clusterResourceGroupName, registryStorageAccountName, gomock.Eq(updated))
storage.EXPECT().Update(gomock.Any(), clusterResourceGroupName, registryStorageAccountName, updated)
},
imageregistrycli: imageregistryfake.NewSimpleClientset(
&imageregistryv1.Config{
Expand Down