@@ -272,6 +272,25 @@ func TestReconciler(t *testing.T) {
272
272
}
273
273
return nil
274
274
}),
275
+ MockStatusPatch : test .NewMockStatusPatchFn (nil , func (o runtime.Object ) error {
276
+ want := ac (
277
+ withConditions (runtimev1alpha1 .ReconcileSuccess ()),
278
+ withWorkloadStatuses (v1alpha2.WorkloadStatus {
279
+ ComponentName : componentName ,
280
+ Reference : runtimev1alpha1.TypedReference {
281
+ APIVersion : workload .GetAPIVersion (),
282
+ Kind : workload .GetKind (),
283
+ Name : workload .GetName (),
284
+ },
285
+ }),
286
+ withDependencyStatus (depStatus ),
287
+ )
288
+ if diff := cmp .Diff (want , o .(* v1alpha2.ApplicationConfiguration ), cmpopts .EquateEmpty ()); diff != "" {
289
+ t .Errorf ("\n client.Status().Update(): -want, +got:\n %s" , diff )
290
+ return errUnexpectedStatus
291
+ }
292
+ return nil
293
+ }),
275
294
},
276
295
},
277
296
o : []ReconcilerOption {
@@ -362,6 +381,24 @@ func TestReconciler(t *testing.T) {
362
381
}
363
382
return nil
364
383
}),
384
+ MockStatusPatch : test .NewMockStatusPatchFn (nil , func (o runtime.Object ) error {
385
+ want := ac (
386
+ withWorkloadStatuses (v1alpha2.WorkloadStatus {
387
+ ComponentName : componentName ,
388
+ Reference : runtimev1alpha1.TypedReference {
389
+ APIVersion : workload .GetAPIVersion (),
390
+ Kind : workload .GetKind (),
391
+ Name : workload .GetName (),
392
+ },
393
+ }),
394
+ )
395
+ want .SetConditions (runtimev1alpha1 .ReconcileSuccess ())
396
+ if diff := cmp .Diff (want , o .(* v1alpha2.ApplicationConfiguration ), cmpopts .EquateEmpty ()); diff != "" {
397
+ t .Errorf ("\n client.Status().Update(): -want, +got:\n %s" , diff )
398
+ return errUnexpectedStatus
399
+ }
400
+ return nil
401
+ }),
365
402
},
366
403
},
367
404
o : []ReconcilerOption {
@@ -461,6 +498,24 @@ func TestReconciler(t *testing.T) {
461
498
}
462
499
return nil
463
500
}),
501
+ MockStatusPatch : test .NewMockStatusPatchFn (nil , func (o runtime.Object ) error {
502
+ want := ac (
503
+ withConditions (runtimev1alpha1 .ReconcileSuccess ()),
504
+ withWorkloadStatuses (v1alpha2.WorkloadStatus {
505
+ ComponentName : componentName ,
506
+ Reference : runtimev1alpha1.TypedReference {
507
+ APIVersion : workload .GetAPIVersion (),
508
+ Kind : workload .GetKind (),
509
+ Name : workload .GetName (),
510
+ },
511
+ }),
512
+ )
513
+ if diff := cmp .Diff (want , o .(* v1alpha2.ApplicationConfiguration ), cmpopts .EquateEmpty ()); diff != "" {
514
+ t .Errorf ("\n client.Status().Update(): -want, +got:\n %s" , diff )
515
+ return errUnexpectedStatus
516
+ }
517
+ return nil
518
+ }),
464
519
},
465
520
},
466
521
o : []ReconcilerOption {
0 commit comments