@@ -120,7 +120,9 @@ void ifExecutionInProgressWaitsUntilItsFinished() {
120120 void schedulesAnEventRetryOnException () {
121121 TestCustomResource customResource = testCustomResource ();
122122
123- ExecutionScope executionScope = new ExecutionScope (customResource , null );
123+ ExecutionScope executionScope =
124+ new ExecutionScope (null );
125+ executionScope .setResource (customResource );
124126 PostExecutionControl postExecutionControl =
125127 PostExecutionControl .exceptionDuringExecution (new RuntimeException ("test" ));
126128
@@ -254,7 +256,7 @@ void cancelScheduleOnceEventsOnSuccessfulExecution() {
254256 var crID = new ResourceID ("test-cr" , TEST_NAMESPACE );
255257 var cr = testCustomResource (crID );
256258
257- eventProcessor .eventProcessingFinished (new ExecutionScope (cr , null ),
259+ eventProcessor .eventProcessingFinished (new ExecutionScope (null ). setResource ( cr ),
258260 PostExecutionControl .defaultDispatch ());
259261
260262 verify (retryTimerEventSourceMock , times (1 )).cancelOnceSchedule (eq (crID ));
@@ -283,7 +285,8 @@ void startProcessedMarkedEventReceivedBefore() {
283285 @ Test
284286 void updatesEventSourceHandlerIfResourceUpdated () {
285287 TestCustomResource customResource = testCustomResource ();
286- ExecutionScope executionScope = new ExecutionScope (customResource , null );
288+ ExecutionScope executionScope =
289+ new ExecutionScope (null ).setResource (customResource );
287290 PostExecutionControl postExecutionControl =
288291 PostExecutionControl .customResourceUpdated (customResource );
289292
@@ -297,7 +300,8 @@ void updatesEventSourceHandlerIfResourceUpdated() {
297300 @ Test
298301 void notUpdatesEventSourceHandlerIfResourceUpdated () {
299302 TestCustomResource customResource = testCustomResource ();
300- ExecutionScope executionScope = new ExecutionScope (customResource , null );
303+ ExecutionScope executionScope =
304+ new ExecutionScope (null ).setResource (customResource );
301305 PostExecutionControl postExecutionControl =
302306 PostExecutionControl .customResourceStatusPatched (customResource );
303307
@@ -311,7 +315,8 @@ void notUpdatesEventSourceHandlerIfResourceUpdated() {
311315 void notReschedulesAfterTheFinalizerRemoveProcessed () {
312316 TestCustomResource customResource = testCustomResource ();
313317 markForDeletion (customResource );
314- ExecutionScope executionScope = new ExecutionScope (customResource , null );
318+ ExecutionScope executionScope =
319+ new ExecutionScope (null ).setResource (customResource );
315320 PostExecutionControl postExecutionControl =
316321 PostExecutionControl .customResourceFinalizerRemoved (customResource );
317322
@@ -324,7 +329,8 @@ void notReschedulesAfterTheFinalizerRemoveProcessed() {
324329 void skipEventProcessingIfFinalizerRemoveProcessed () {
325330 TestCustomResource customResource = testCustomResource ();
326331 markForDeletion (customResource );
327- ExecutionScope executionScope = new ExecutionScope (customResource , null );
332+ ExecutionScope executionScope =
333+ new ExecutionScope (null ).setResource (customResource );
328334 PostExecutionControl postExecutionControl =
329335 PostExecutionControl .customResourceFinalizerRemoved (customResource );
330336
@@ -341,7 +347,8 @@ void skipEventProcessingIfFinalizerRemoveProcessed() {
341347 void newResourceAfterMissedDeleteEvent () {
342348 TestCustomResource customResource = testCustomResource ();
343349 markForDeletion (customResource );
344- ExecutionScope executionScope = new ExecutionScope (customResource , null );
350+ ExecutionScope executionScope =
351+ new ExecutionScope (null ).setResource (customResource );
345352 PostExecutionControl postExecutionControl =
346353 PostExecutionControl .customResourceFinalizerRemoved (customResource );
347354 var newResource = testCustomResource ();
@@ -377,7 +384,8 @@ void rateLimitsReconciliationSubmission() {
377384 @ Test
378385 void schedulesRetryForMarReconciliationInterval () {
379386 TestCustomResource customResource = testCustomResource ();
380- ExecutionScope executionScope = new ExecutionScope (customResource , null );
387+ ExecutionScope executionScope =
388+ new ExecutionScope (null ).setResource (customResource );
381389 PostExecutionControl postExecutionControl =
382390 PostExecutionControl .defaultDispatch ();
383391
@@ -398,7 +406,8 @@ void schedulesRetryForMarReconciliationIntervalIfRetryExhausted() {
398406 eventSourceManagerMock ,
399407 metricsMock ));
400408 eventProcessorWithRetry .start ();
401- ExecutionScope executionScope = new ExecutionScope (testCustomResource (), null );
409+ ExecutionScope executionScope =
410+ new ExecutionScope (null ).setResource (testCustomResource ());
402411 PostExecutionControl postExecutionControl =
403412 PostExecutionControl .exceptionDuringExecution (new RuntimeException ());
404413 when (eventProcessorWithRetry .retryEventSource ()).thenReturn (retryTimerEventSourceMock );
0 commit comments