@@ -120,7 +120,9 @@ void ifExecutionInProgressWaitsUntilItsFinished() {
120
120
void schedulesAnEventRetryOnException() {
121
121
TestCustomResource customResource = testCustomResource();
122
122
123
- ExecutionScope executionScope = new ExecutionScope(customResource, null);
123
+ ExecutionScope executionScope =
124
+ new ExecutionScope(null);
125
+ executionScope.setResource(customResource);
124
126
PostExecutionControl postExecutionControl =
125
127
PostExecutionControl.exceptionDuringExecution(new RuntimeException("test"));
126
128
@@ -254,7 +256,7 @@ void cancelScheduleOnceEventsOnSuccessfulExecution() {
254
256
var crID = new ResourceID("test-cr", TEST_NAMESPACE);
255
257
var cr = testCustomResource(crID);
256
258
257
- eventProcessor.eventProcessingFinished(new ExecutionScope(cr, null),
259
+ eventProcessor.eventProcessingFinished(new ExecutionScope(null).setResource(cr ),
258
260
PostExecutionControl.defaultDispatch());
259
261
260
262
verify(retryTimerEventSourceMock, times(1)).cancelOnceSchedule(eq(crID));
@@ -283,7 +285,8 @@ void startProcessedMarkedEventReceivedBefore() {
283
285
@Test
284
286
void updatesEventSourceHandlerIfResourceUpdated() {
285
287
TestCustomResource customResource = testCustomResource();
286
- ExecutionScope executionScope = new ExecutionScope(customResource, null);
288
+ ExecutionScope executionScope =
289
+ new ExecutionScope(null).setResource(customResource);
287
290
PostExecutionControl postExecutionControl =
288
291
PostExecutionControl.customResourceUpdated(customResource);
289
292
@@ -297,7 +300,8 @@ void updatesEventSourceHandlerIfResourceUpdated() {
297
300
@Test
298
301
void notUpdatesEventSourceHandlerIfResourceUpdated() {
299
302
TestCustomResource customResource = testCustomResource();
300
- ExecutionScope executionScope = new ExecutionScope(customResource, null);
303
+ ExecutionScope executionScope =
304
+ new ExecutionScope(null).setResource(customResource);
301
305
PostExecutionControl postExecutionControl =
302
306
PostExecutionControl.customResourceStatusPatched(customResource);
303
307
@@ -311,7 +315,8 @@ void notUpdatesEventSourceHandlerIfResourceUpdated() {
311
315
void notReschedulesAfterTheFinalizerRemoveProcessed() {
312
316
TestCustomResource customResource = testCustomResource();
313
317
markForDeletion(customResource);
314
- ExecutionScope executionScope = new ExecutionScope(customResource, null);
318
+ ExecutionScope executionScope =
319
+ new ExecutionScope(null).setResource(customResource);
315
320
PostExecutionControl postExecutionControl =
316
321
PostExecutionControl.customResourceFinalizerRemoved(customResource);
317
322
@@ -324,7 +329,8 @@ void notReschedulesAfterTheFinalizerRemoveProcessed() {
324
329
void skipEventProcessingIfFinalizerRemoveProcessed() {
325
330
TestCustomResource customResource = testCustomResource();
326
331
markForDeletion(customResource);
327
- ExecutionScope executionScope = new ExecutionScope(customResource, null);
332
+ ExecutionScope executionScope =
333
+ new ExecutionScope(null).setResource(customResource);
328
334
PostExecutionControl postExecutionControl =
329
335
PostExecutionControl.customResourceFinalizerRemoved(customResource);
330
336
@@ -341,7 +347,8 @@ void skipEventProcessingIfFinalizerRemoveProcessed() {
341
347
void newResourceAfterMissedDeleteEvent() {
342
348
TestCustomResource customResource = testCustomResource();
343
349
markForDeletion(customResource);
344
- ExecutionScope executionScope = new ExecutionScope(customResource, null);
350
+ ExecutionScope executionScope =
351
+ new ExecutionScope(null).setResource(customResource);
345
352
PostExecutionControl postExecutionControl =
346
353
PostExecutionControl.customResourceFinalizerRemoved(customResource);
347
354
var newResource = testCustomResource();
@@ -377,7 +384,8 @@ void rateLimitsReconciliationSubmission() {
377
384
@Test
378
385
void schedulesRetryForMarReconciliationInterval() {
379
386
TestCustomResource customResource = testCustomResource();
380
- ExecutionScope executionScope = new ExecutionScope(customResource, null);
387
+ ExecutionScope executionScope =
388
+ new ExecutionScope(null).setResource(customResource);
381
389
PostExecutionControl postExecutionControl =
382
390
PostExecutionControl.defaultDispatch();
383
391
@@ -398,7 +406,8 @@ void schedulesRetryForMarReconciliationIntervalIfRetryExhausted() {
398
406
eventSourceManagerMock,
399
407
metricsMock));
400
408
eventProcessorWithRetry.start();
401
- ExecutionScope executionScope = new ExecutionScope(testCustomResource(), null);
409
+ ExecutionScope executionScope =
410
+ new ExecutionScope(null).setResource(testCustomResource());
402
411
PostExecutionControl postExecutionControl =
403
412
PostExecutionControl.exceptionDuringExecution(new RuntimeException());
404
413
when(eventProcessorWithRetry.retryEventSource()).thenReturn(retryTimerEventSourceMock);
0 commit comments