@@ -13,7 +13,7 @@ import (
1313 "github.com/teutonet/cluster-api-provider-hosted-control-plane/pkg/reconcilers/alias"
1414 "github.com/teutonet/cluster-api-provider-hosted-control-plane/pkg/reconcilers/etcd_cluster/etcd_client"
1515 "github.com/teutonet/cluster-api-provider-hosted-control-plane/pkg/reconcilers/etcd_cluster/s3_client"
16- "github.com/teutonet/cluster-api-provider-hosted-control-plane/test"
16+ . "github.com/teutonet/cluster-api-provider-hosted-control-plane/test"
1717 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1818 "k8s.io/apimachinery/pkg/runtime"
1919 "k8s.io/apimachinery/pkg/types"
3333 _ * v1alpha1.HostedControlPlane ,
3434 _ * capiv2.Cluster ,
3535 ) (s3_client.S3Client , error ) {
36- return test . NewS3ClientStub (), nil
36+ return NewS3ClientStub (), nil
3737 }
3838 etcdClientStubFactory = func (
3939 _ context.Context ,
4242 _ * capiv2.Cluster ,
4343 _ int32 ,
4444 ) (etcd_client.EtcdClient , error ) {
45- return test . NewEtcdClientStub (), nil
45+ return NewEtcdClientStub (), nil
4646 }
4747 workloadClusterClientStubFactory = func (
4848 _ context.Context ,
@@ -66,7 +66,7 @@ func createTestReconciler(client client.Client) HostedControlPlaneReconciler {
6666 workloadClusterClientStubFactory ,
6767 etcdClientStubFactory ,
6868 s3ClientStubFactory ,
69- test . NewEtcdVolumeStatsProviderStub (),
69+ NewEtcdVolumeStatsProviderStub (),
7070 & recorder.InfiniteDiscardingFakeRecorder {},
7171 "test-namespace" ,
7272 )
@@ -214,7 +214,7 @@ func TestHostedControlPlaneReconciler_ReconcileWorkflow(t *testing.T) {
214214 for _ , tt := range tests {
215215 t .Run (tt .name , func (t * testing.T ) {
216216 ctx := t .Context ()
217- g := NewWithT (t )
217+ g , _ , _ := G (t )
218218 scheme := runtime .NewScheme ()
219219 g .Expect (capiv2 .AddToScheme (scheme )).To (Succeed ())
220220 g .Expect (v1alpha1 .AddToScheme (scheme )).To (Succeed ())
@@ -264,13 +264,13 @@ func TestHostedControlPlaneReconciler_ReconcileWorkflow(t *testing.T) {
264264
265265func TestHostedControlPlaneReconciler_FinalizerManagement (t * testing.T ) {
266266 scheme := runtime .NewScheme ()
267- g := NewWithT (t )
267+ g , _ , _ := G (t )
268268 g .Expect (v1alpha1 .AddToScheme (scheme )).To (Succeed ())
269269 g .Expect (capiv2 .AddToScheme (scheme )).To (Succeed ())
270270
271271 t .Run ("finalizer behavior during reconcile lifecycle" , func (t * testing.T ) {
272272 ctx := t .Context ()
273- g := NewWithT (t )
273+ g , _ , _ := G (t )
274274 cluster := createTestCluster ("test-cluster" , "default" )
275275 hostedControlPlane := withReplicas (
276276 withOwnerReference (createTestHostedControlPlane ("test-hcp" , "default" ), cluster ),
@@ -313,7 +313,7 @@ func TestHostedControlPlaneReconciler_FinalizerManagement(t *testing.T) {
313313
314314 t .Run ("finalizer should be removed during deletion" , func (t * testing.T ) {
315315 ctx := t .Context ()
316- g := NewWithT (t )
316+ g , _ , _ := G (t )
317317 cluster := createTestClusterWithPausedCondition ("test-cluster" , "default" , false )
318318 hostedControlPlane := withDeletion (
319319 withOwnerReference (createTestHostedControlPlane ("test-hcp" , "default" ), cluster ),
@@ -360,13 +360,13 @@ func TestHostedControlPlaneReconciler_FinalizerManagement(t *testing.T) {
360360
361361func TestHostedControlPlaneReconciler_OwnerReferenceValidation (t * testing.T ) {
362362 scheme := runtime .NewScheme ()
363- g := NewWithT (t )
363+ g , _ , _ := G (t )
364364 g .Expect (v1alpha1 .AddToScheme (scheme )).To (Succeed ())
365365 g .Expect (capiv2 .AddToScheme (scheme )).To (Succeed ())
366366
367367 t .Run ("should requeue when owner cluster is not found" , func (t * testing.T ) {
368368 ctx := t .Context ()
369- g := NewWithT (t )
369+ g , _ , _ := G (t )
370370 hostedControlPlane := createTestHostedControlPlane ("test-hcp" , "default" )
371371
372372 fakeClient := fakeClient .NewClientBuilder ().
@@ -393,7 +393,7 @@ func TestHostedControlPlaneReconciler_OwnerReferenceValidation(t *testing.T) {
393393
394394 t .Run ("should proceed when valid owner cluster is found" , func (t * testing.T ) {
395395 ctx := t .Context ()
396- g := NewWithT (t )
396+ g , _ , _ := G (t )
397397 cluster := createTestCluster ("test-cluster" , "default" )
398398 hostedControlPlane := withReplicas (
399399 withOwnerReference (createTestHostedControlPlane ("test-hcp" , "default" ), cluster ),
@@ -430,13 +430,13 @@ func TestHostedControlPlaneReconciler_OwnerReferenceValidation(t *testing.T) {
430430
431431func TestHostedControlPlaneReconciler_StatusConditions (t * testing.T ) {
432432 scheme := runtime .NewScheme ()
433- g := NewWithT (t )
433+ g , _ , _ := G (t )
434434 g .Expect (v1alpha1 .AddToScheme (scheme )).To (Succeed ())
435435 g .Expect (capiv2 .AddToScheme (scheme )).To (Succeed ())
436436
437437 t .Run ("should set paused condition when cluster is paused" , func (t * testing.T ) {
438438 ctx := t .Context ()
439- g := NewWithT (t )
439+ g , _ , _ := G (t )
440440 cluster := withPaused (createTestCluster ("test-cluster" , "default" ), true )
441441 hostedControlPlane := withOwnerReference (createTestHostedControlPlane ("test-hcp" , "default" ), cluster )
442442
@@ -482,7 +482,7 @@ func TestHostedControlPlaneReconciler_StatusConditions(t *testing.T) {
482482
483483func TestHostedControlPlaneReconciler_ObservedGeneration (t * testing.T ) {
484484 scheme := runtime .NewScheme ()
485- g := NewWithT (t )
485+ g , _ , _ := G (t )
486486 g .Expect (v1alpha1 .AddToScheme (scheme )).To (Succeed ())
487487 g .Expect (capiv2 .AddToScheme (scheme )).To (Succeed ())
488488
@@ -534,7 +534,7 @@ func TestHostedControlPlaneReconciler_ObservedGeneration(t *testing.T) {
534534 for _ , tt := range tests {
535535 t .Run (tt .name , func (t * testing.T ) {
536536 ctx := t .Context ()
537- g := NewWithT (t )
537+ g , _ , _ := G (t )
538538
539539 objs := []client.Object {tt .hostedControlPlane }
540540 if tt .cluster != nil {
@@ -584,7 +584,7 @@ func TestHostedControlPlaneReconciler_ObservedGeneration(t *testing.T) {
584584
585585func TestHostedControlPlaneReconciler_NonExistentResource (t * testing.T ) {
586586 scheme := runtime .NewScheme ()
587- g := NewWithT (t )
587+ g , _ , _ := G (t )
588588 g .Expect (v1alpha1 .AddToScheme (scheme )).To (Succeed ())
589589
590590 fakeClient := fakeClient .NewClientBuilder ().
0 commit comments