From f006e0824be987b16a6419fa19a307dd4863a290 Mon Sep 17 00:00:00 2001 From: Cavaughn Browne Date: Wed, 22 Feb 2023 16:48:07 -0600 Subject: [PATCH] removed duplicate test --- pkg/cluster/cloudstack_test.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pkg/cluster/cloudstack_test.go b/pkg/cluster/cloudstack_test.go index bf243534a3363..6cb8ae2a9bcdc 100644 --- a/pkg/cluster/cloudstack_test.go +++ b/pkg/cluster/cloudstack_test.go @@ -6,11 +6,10 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/controller-runtime/pkg/client/fake" + "github.com/aws/eks-anywhere/internal/test" anywherev1 "github.com/aws/eks-anywhere/pkg/api/v1alpha1" "github.com/aws/eks-anywhere/pkg/cluster" - "github.com/aws/eks-anywhere/pkg/controller/clientutil" ) func TestParseConfigMissingCloudstackDatacenter(t *testing.T) { @@ -37,12 +36,8 @@ func TestDefaultConfigClientBuilderBuildCloudStackClusterSuccess(t *testing.T) { }, } - client := fake.NewClientBuilder().WithObjects().Build() - _, err := b.Build(ctx, clientutil.NewKubeClient(client), cluster) - g.Expect(err).To(MatchError(ContainSubstring("building Config from a cluster client"))) - - client = fake.NewClientBuilder().WithObjects(datacenter).Build() - config, err := b.Build(ctx, clientutil.NewKubeClient(client), cluster) + client := test.NewFakeKubeClient(datacenter) + config, err := b.Build(ctx, client, cluster) g.Expect(err).NotTo(HaveOccurred()) g.Expect(config).NotTo(BeNil()) g.Expect(config.Cluster).To(Equal(cluster)) @@ -54,8 +49,8 @@ func TestDefaultConfigClientBuilderBuildCloudStackClusterFailure(t *testing.T) { ctx := context.Background() b := cluster.NewDefaultConfigClientBuilder() cluster := cloudStackCluster() - client := fake.NewClientBuilder().WithObjects().Build() - _, err := b.Build(ctx, clientutil.NewKubeClient(client), cluster) + client := test.NewFakeKubeClient() + _, err := b.Build(ctx, client, cluster) g.Expect(err).To(MatchError(ContainSubstring("cloudstackdatacenterconfigs.anywhere.eks.amazonaws.com \"datacenter\" not found"))) }