77import static org .junit .jupiter .api .Assertions .assertNull ;
88import static org .junit .jupiter .api .Assertions .assertThrows ;
99import static org .mockito .ArgumentMatchers .any ;
10- import static org .mockito .ArgumentMatchers .eq ;
1110import static org .mockito .Mockito .mock ;
1211import static org .mockito .Mockito .never ;
1312import static org .mockito .Mockito .times ;
@@ -45,8 +44,7 @@ class BaseDurableOperationTest {
4544 void getOperation () {
4645 ExecutionManager executionManager = mock (ExecutionManager .class );
4746 Operation operation = mock (Operation .class );
48- when (executionManager .getOperationAndUpdateReplayState (eq (OPERATION_ID )))
49- .thenReturn (operation );
47+ when (executionManager .getOperationAndUpdateReplayState (OPERATION_ID )).thenReturn (operation );
5048
5149 BaseDurableOperation <String > op =
5250 new BaseDurableOperation <>(
@@ -72,8 +70,8 @@ void waitForOperationCompletionThrowsIfInStep() {
7270 Phaser phaser = new Phaser ();
7371 ExecutionManager executionManager = mock (ExecutionManager .class );
7472 when (executionManager .getCurrentContext ()).thenReturn (new OperationContext ("context" , ThreadType .STEP ));
75- when (executionManager .startPhaser (eq ( OPERATION_ID ) )).thenReturn (phaser );
76- when (executionManager .getOperationAndUpdateReplayState (eq ( OPERATION_ID ) ))
73+ when (executionManager .startPhaser (OPERATION_ID )).thenReturn (phaser );
74+ when (executionManager .getOperationAndUpdateReplayState (OPERATION_ID ))
7775 .thenReturn (Operation .builder ().build ());
7876
7977 BaseDurableOperation <String > op =
@@ -99,7 +97,7 @@ void waitForOperationCompletionThrowsIfOperationMissing() {
9997 Phaser phaser = new Phaser ();
10098 ExecutionManager executionManager = mock (ExecutionManager .class );
10199 when (executionManager .getCurrentContext ()).thenReturn (new OperationContext ("context" , ThreadType .CONTEXT ));
102- when (executionManager .startPhaser (eq ( OPERATION_ID ) )).thenReturn (phaser );
100+ when (executionManager .startPhaser (OPERATION_ID )).thenReturn (phaser );
103101
104102 BaseDurableOperation <String > op =
105103 new BaseDurableOperation <>(
@@ -124,8 +122,8 @@ void waitForOperationCompletionWhenRunningAndReadyToComplete() {
124122 OperationContext context = new OperationContext ("step" , ThreadType .CONTEXT );
125123 ExecutionManager executionManager = mock (ExecutionManager .class );
126124 when (executionManager .getCurrentContext ()).thenReturn (context );
127- when (executionManager .startPhaser (eq ( OPERATION_ID ) )).thenReturn (phaser );
128- when (executionManager .getOperationAndUpdateReplayState (eq ( OPERATION_ID ) ))
125+ when (executionManager .startPhaser (OPERATION_ID )).thenReturn (phaser );
126+ when (executionManager .getOperationAndUpdateReplayState (OPERATION_ID ))
129127 .thenReturn (Operation .builder ().build ());
130128
131129 BaseDurableOperation <String > op =
@@ -155,8 +153,8 @@ void waitForOperationCompletionWhenAlreadyCompleted() {
155153 OperationContext context = new OperationContext ("step" , ThreadType .CONTEXT );
156154 ExecutionManager executionManager = mock (ExecutionManager .class );
157155 when (executionManager .getCurrentContext ()).thenReturn (context );
158- when (executionManager .startPhaser (eq ( OPERATION_ID ) )).thenReturn (phaser );
159- when (executionManager .getOperationAndUpdateReplayState (eq ( OPERATION_ID ) ))
156+ when (executionManager .startPhaser (OPERATION_ID )).thenReturn (phaser );
157+ when (executionManager .getOperationAndUpdateReplayState (OPERATION_ID ))
160158 .thenReturn (Operation .builder ().build ());
161159
162160 BaseDurableOperation <String > op =
@@ -185,8 +183,8 @@ void markAlreadyCompleted() {
185183 OperationContext context = new OperationContext ("step" , ThreadType .STEP );
186184 ExecutionManager executionManager = mock (ExecutionManager .class );
187185 when (executionManager .getCurrentContext ()).thenReturn (context );
188- when (executionManager .startPhaser (eq ( OPERATION_ID ) )).thenReturn (phaser );
189- when (executionManager .getOperationAndUpdateReplayState (eq ( OPERATION_ID ) ))
186+ when (executionManager .startPhaser (OPERATION_ID )).thenReturn (phaser );
187+ when (executionManager .getOperationAndUpdateReplayState (OPERATION_ID ))
190188 .thenReturn (Operation .builder ().build ());
191189
192190 BaseDurableOperation <String > op =
@@ -214,8 +212,8 @@ void validateReplayThrowsWhenTypeMismatch() {
214212 OperationContext context = new OperationContext ("step" , ThreadType .STEP );
215213 ExecutionManager executionManager = mock (ExecutionManager .class );
216214 when (executionManager .getCurrentContext ()).thenReturn (context );
217- when (executionManager .startPhaser (eq ( OPERATION_ID ) )).thenReturn (phaser );
218- when (executionManager .getOperationAndUpdateReplayState (eq ( OPERATION_ID ) ))
215+ when (executionManager .startPhaser (OPERATION_ID )).thenReturn (phaser );
216+ when (executionManager .getOperationAndUpdateReplayState (OPERATION_ID ))
219217 .thenReturn (
220218 Operation .builder ().type (OperationType .CHAINED_INVOKE ).build ());
221219
@@ -241,8 +239,8 @@ void validateReplayThrowsWhenNameMismatch() {
241239 OperationContext context = new OperationContext ("step" , ThreadType .STEP );
242240 ExecutionManager executionManager = mock (ExecutionManager .class );
243241 when (executionManager .getCurrentContext ()).thenReturn (context );
244- when (executionManager .startPhaser (eq ( OPERATION_ID ) )).thenReturn (phaser );
245- when (executionManager .getOperationAndUpdateReplayState (eq ( OPERATION_ID ) ))
242+ when (executionManager .startPhaser (OPERATION_ID )).thenReturn (phaser );
243+ when (executionManager .getOperationAndUpdateReplayState (OPERATION_ID ))
246244 .thenReturn (Operation .builder ()
247245 .name ("another name" )
248246 .type (OPERATION_TYPE )
@@ -270,9 +268,8 @@ void validateReplayDoesNotThrowWhenNoOperation() {
270268 OperationContext context = new OperationContext ("step" , ThreadType .STEP );
271269 ExecutionManager executionManager = mock (ExecutionManager .class );
272270 when (executionManager .getCurrentContext ()).thenReturn (context );
273- when (executionManager .startPhaser (eq (OPERATION_ID ))).thenReturn (phaser );
274- when (executionManager .getOperationAndUpdateReplayState (eq (OPERATION_ID )))
275- .thenReturn (null );
271+ when (executionManager .startPhaser (OPERATION_ID )).thenReturn (phaser );
272+ when (executionManager .getOperationAndUpdateReplayState (OPERATION_ID )).thenReturn (null );
276273
277274 BaseDurableOperation <String > op =
278275 new BaseDurableOperation <>(
@@ -294,8 +291,8 @@ void validateReplayDoesNotThrowWhenNameAndTypeMatch() {
294291 OperationContext context = new OperationContext ("step" , ThreadType .STEP );
295292 ExecutionManager executionManager = mock (ExecutionManager .class );
296293 when (executionManager .getCurrentContext ()).thenReturn (context );
297- when (executionManager .startPhaser (eq ( OPERATION_ID ) )).thenReturn (phaser );
298- when (executionManager .getOperationAndUpdateReplayState (eq ( OPERATION_ID ) ))
294+ when (executionManager .startPhaser (OPERATION_ID )).thenReturn (phaser );
295+ when (executionManager .getOperationAndUpdateReplayState (OPERATION_ID ))
299296 .thenReturn (Operation .builder ()
300297 .name (OPERATION_NAME )
301298 .type (OPERATION_TYPE )
@@ -321,8 +318,8 @@ void deserializeResult() {
321318 OperationContext context = new OperationContext ("step" , ThreadType .STEP );
322319 ExecutionManager executionManager = mock (ExecutionManager .class );
323320 when (executionManager .getCurrentContext ()).thenReturn (context );
324- when (executionManager .startPhaser (eq ( OPERATION_ID ) )).thenReturn (phaser );
325- when (executionManager .getOperationAndUpdateReplayState (eq ( OPERATION_ID ) ))
321+ when (executionManager .startPhaser (OPERATION_ID )).thenReturn (phaser );
322+ when (executionManager .getOperationAndUpdateReplayState (OPERATION_ID ))
326323 .thenReturn (Operation .builder ()
327324 .name (OPERATION_NAME )
328325 .type (OPERATION_TYPE )
@@ -351,8 +348,8 @@ void deserializeException() {
351348 OperationContext context = new OperationContext ("step" , ThreadType .STEP );
352349 ExecutionManager executionManager = mock (ExecutionManager .class );
353350 when (executionManager .getCurrentContext ()).thenReturn (context );
354- when (executionManager .startPhaser (eq ( OPERATION_ID ) )).thenReturn (phaser );
355- when (executionManager .getOperationAndUpdateReplayState (eq ( OPERATION_ID ) ))
351+ when (executionManager .startPhaser (OPERATION_ID )).thenReturn (phaser );
352+ when (executionManager .getOperationAndUpdateReplayState (OPERATION_ID ))
356353 .thenReturn (Operation .builder ()
357354 .name (OPERATION_NAME )
358355 .type (OPERATION_TYPE )
@@ -386,8 +383,8 @@ void polling() {
386383 OperationContext context = new OperationContext ("step" , ThreadType .STEP );
387384 ExecutionManager executionManager = mock (ExecutionManager .class );
388385 when (executionManager .getCurrentContext ()).thenReturn (context );
389- when (executionManager .startPhaser (eq ( OPERATION_ID ) )).thenReturn (phaser );
390- when (executionManager .getOperationAndUpdateReplayState (eq ( OPERATION_ID ) ))
386+ when (executionManager .startPhaser (OPERATION_ID )).thenReturn (phaser );
387+ when (executionManager .getOperationAndUpdateReplayState (OPERATION_ID ))
391388 .thenReturn (Operation .builder ()
392389 .name (OPERATION_NAME )
393390 .type (OPERATION_TYPE )
@@ -420,8 +417,8 @@ void sendOperationUpdate() {
420417 OperationContext context = new OperationContext ("step" , ThreadType .STEP );
421418 ExecutionManager executionManager = mock (ExecutionManager .class );
422419 when (executionManager .getCurrentContext ()).thenReturn (context );
423- when (executionManager .startPhaser (eq ( OPERATION_ID ) )).thenReturn (phaser );
424- when (executionManager .getOperationAndUpdateReplayState (eq ( OPERATION_ID ) ))
420+ when (executionManager .startPhaser (OPERATION_ID )).thenReturn (phaser );
421+ when (executionManager .getOperationAndUpdateReplayState (OPERATION_ID ))
425422 .thenReturn (Operation .builder ()
426423 .name (OPERATION_NAME )
427424 .type (OPERATION_TYPE )
0 commit comments