@@ -129,7 +129,8 @@ void addFinalizerOnNewResource() {
129
129
.reconcile (ArgumentMatchers .eq (testCustomResource ), any ());
130
130
verify (customResourceFacade , times (1 ))
131
131
.patchResource (
132
- argThat (testCustomResource -> testCustomResource .hasFinalizer (DEFAULT_FINALIZER )),any ());
132
+ argThat (testCustomResource -> testCustomResource .hasFinalizer (DEFAULT_FINALIZER )),
133
+ any ());
133
134
assertThat (testCustomResource .hasFinalizer (DEFAULT_FINALIZER )).isTrue ();
134
135
}
135
136
@@ -324,21 +325,21 @@ void doesNotUpdateTheResourceIfNoUpdateUpdateControlIfFinalizerSet() {
324
325
325
326
reconciliationDispatcher .handleExecution (executionScopeWithCREvent (testCustomResource ));
326
327
verify (customResourceFacade , never ()).patchResource (any (), any ());
327
- verify (customResourceFacade , never ()).patchStatus (eq (testCustomResource ),any ());
328
+ verify (customResourceFacade , never ()).patchStatus (eq (testCustomResource ), any ());
328
329
}
329
330
330
331
@ Test
331
332
void addsFinalizerIfNotMarkedForDeletionAndEmptyCustomResourceReturned () {
332
333
removeFinalizers (testCustomResource );
333
334
reconciler .reconcile = (r , c ) -> UpdateControl .noUpdate ();
334
- when (customResourceFacade .patchResource (any (),any ()))
335
+ when (customResourceFacade .patchResource (any (), any ()))
335
336
.thenReturn (testCustomResource );
336
337
337
338
var postExecControl =
338
339
reconciliationDispatcher .handleExecution (executionScopeWithCREvent (testCustomResource ));
339
340
340
341
assertEquals (1 , testCustomResource .getMetadata ().getFinalizers ().size ());
341
- verify (customResourceFacade , times (1 )).patchResource (any (),any ());
342
+ verify (customResourceFacade , times (1 )).patchResource (any (), any ());
342
343
assertThat (postExecControl .updateIsStatusPatch ()).isFalse ();
343
344
assertThat (postExecControl .getUpdatedCustomResource ()).isPresent ();
344
345
}
@@ -350,7 +351,7 @@ void doesNotCallDeleteIfMarkedForDeletionButNotOurFinalizer() {
350
351
351
352
reconciliationDispatcher .handleExecution (executionScopeWithCREvent (testCustomResource ));
352
353
353
- verify (customResourceFacade , never ()).patchResource (any (),any ());
354
+ verify (customResourceFacade , never ()).patchResource (any (), any ());
354
355
verify (reconciler , never ()).cleanup (eq (testCustomResource ), any ());
355
356
}
356
357
@@ -453,7 +454,7 @@ void updatesObservedGenerationOnNoUpdateUpdateControl() throws Exception {
453
454
when (config .isGenerationAware ()).thenReturn (true );
454
455
when (reconciler .reconcile (any (), any ()))
455
456
.thenReturn (UpdateControl .noUpdate ());
456
- when (facade .patchStatus (any (),any ())).thenReturn (observedGenResource );
457
+ when (facade .patchStatus (any (), any ())).thenReturn (observedGenResource );
457
458
var dispatcher = init (observedGenResource , reconciler , config , facade , true );
458
459
459
460
PostExecutionControl <ObservedGenCustomResource > control = dispatcher .handleExecution (
@@ -473,8 +474,8 @@ void patchObservedGenerationOnCustomResourceUpdate() throws Exception {
473
474
when (config .isGenerationAware ()).thenReturn (true );
474
475
when (reconciler .reconcile (any (), any ()))
475
476
.thenReturn (UpdateControl .patchResource (observedGenResource ));
476
- when (facade .patchResource (any (),any ())).thenReturn (observedGenResource );
477
- when (facade .patchStatus (eq (observedGenResource ),any ())).thenReturn (observedGenResource );
477
+ when (facade .patchResource (any (), any ())).thenReturn (observedGenResource );
478
+ when (facade .patchStatus (eq (observedGenResource ), any ())).thenReturn (observedGenResource );
478
479
var dispatcher = init (observedGenResource , reconciler , config , facade , true );
479
480
480
481
PostExecutionControl <ObservedGenCustomResource > control = dispatcher .handleExecution (
@@ -510,7 +511,7 @@ public boolean isLastAttempt() {
510
511
}
511
512
}).setResource (testCustomResource ));
512
513
513
- verify (customResourceFacade , times (1 )).patchStatus (eq (testCustomResource ),any ());
514
+ verify (customResourceFacade , times (1 )).patchStatus (eq (testCustomResource ), any ());
514
515
verify (((ErrorStatusHandler ) reconciler ), times (1 )).updateErrorStatus (eq (testCustomResource ),
515
516
any (), any ());
516
517
}
@@ -529,7 +530,7 @@ void callErrorStatusHandlerEvenOnFirstError() {
529
530
530
531
var postExecControl = reconciliationDispatcher .handleExecution (
531
532
new ExecutionScope (null ).setResource (testCustomResource ));
532
- verify (customResourceFacade , times (1 )).patchStatus (eq (testCustomResource ),any ());
533
+ verify (customResourceFacade , times (1 )).patchStatus (eq (testCustomResource ), any ());
533
534
verify (((ErrorStatusHandler ) reconciler ), times (1 )).updateErrorStatus (eq (testCustomResource ),
534
535
any (), any ());
535
536
assertThat (postExecControl .exceptionDuringExecution ()).isTrue ();
@@ -551,7 +552,7 @@ void errorHandlerCanInstructNoRetryWithUpdate() {
551
552
552
553
verify (((ErrorStatusHandler ) reconciler ), times (1 )).updateErrorStatus (eq (testCustomResource ),
553
554
any (), any ());
554
- verify (customResourceFacade , times (1 )).patchStatus (eq (testCustomResource ),any ());
555
+ verify (customResourceFacade , times (1 )).patchStatus (eq (testCustomResource ), any ());
555
556
assertThat (postExecControl .exceptionDuringExecution ()).isFalse ();
556
557
}
557
558
@@ -571,7 +572,7 @@ void errorHandlerCanInstructNoRetryNoUpdate() {
571
572
572
573
verify (((ErrorStatusHandler ) reconciler ), times (1 )).updateErrorStatus (eq (testCustomResource ),
573
574
any (), any ());
574
- verify (customResourceFacade , times (0 )).patchStatus (eq (testCustomResource ),any ());
575
+ verify (customResourceFacade , times (0 )).patchStatus (eq (testCustomResource ), any ());
575
576
assertThat (postExecControl .exceptionDuringExecution ()).isFalse ();
576
577
}
577
578
@@ -637,7 +638,7 @@ void canSkipSchedulingMaxDelayIf() {
637
638
void retriesAddingFinalizer () {
638
639
removeFinalizers (testCustomResource );
639
640
reconciler .reconcile = (r , c ) -> UpdateControl .noUpdate ();
640
- when (customResourceFacade .patchResource (any (),any ()))
641
+ when (customResourceFacade .patchResource (any (), any ()))
641
642
.thenThrow (new KubernetesClientException (null , 409 , null ))
642
643
.thenReturn (testCustomResource );
643
644
when (customResourceFacade .getResource (any (), any ()))
@@ -648,7 +649,7 @@ void retriesAddingFinalizer() {
648
649
649
650
reconciliationDispatcher .handleExecution (executionScopeWithCREvent (testCustomResource ));
650
651
651
- verify (customResourceFacade , times (2 )).patchResource (any (),any ());
652
+ verify (customResourceFacade , times (2 )).patchResource (any (), any ());
652
653
}
653
654
654
655
@ Test
0 commit comments