@@ -304,6 +304,7 @@ public void callChildWorkflowWithOptions() {
304304
305305 assertEquals (retryPolicy .getMaxNumberOfAttempts (), taskOptions .getRetryPolicy ().getMaxNumberOfAttempts ());
306306 assertEquals (retryPolicy .getFirstRetryInterval (), taskOptions .getRetryPolicy ().getFirstRetryInterval ());
307+ assertEquals (Duration .ZERO , taskOptions .getRetryPolicy ().getRetryTimeout ());
307308 }
308309
309310 @ Test
@@ -327,4 +328,33 @@ public void newUuidTestNoImplementationExceptionTest() {
327328 String expectedMessage = "No implementation found." ;
328329 assertEquals (expectedMessage , runtimeException .getMessage ());
329330 }
331+
332+ @ Test
333+ public void workflowRetryPolicyRetryTimeoutValueShouldHaveRightValueWhenBeingSet () {
334+ String expectedName = "TestActivity" ;
335+ String expectedInput = "TestInput" ;
336+ String expectedInstanceId = "TestInstanceId" ;
337+ WorkflowTaskRetryPolicy retryPolicy = WorkflowTaskRetryPolicy .newBuilder ()
338+ .setMaxNumberOfAttempts (1 )
339+ .setFirstRetryInterval (Duration .ofSeconds (10 ))
340+ .setRetryTimeout (Duration .ofSeconds (10 ))
341+ .build ();
342+ WorkflowTaskOptions executionOptions = new WorkflowTaskOptions (retryPolicy );
343+ ArgumentCaptor <TaskOptions > captor = ArgumentCaptor .forClass (TaskOptions .class );
344+
345+ context .callChildWorkflow (expectedName , expectedInput , expectedInstanceId , executionOptions , String .class );
346+
347+ verify (mockInnerContext , times (1 ))
348+ .callSubOrchestrator (
349+ eq (expectedName ),
350+ eq (expectedInput ),
351+ eq (expectedInstanceId ),
352+ captor .capture (),
353+ eq (String .class )
354+ );
355+
356+ TaskOptions taskOptions = captor .getValue ();
357+
358+ assertEquals (Duration .ofSeconds (10 ), taskOptions .getRetryPolicy ().getRetryTimeout ());
359+ }
330360}
0 commit comments