Skip to content

Commit 3c61bc2

Browse files
committed
Address comments
Signed-off-by: siri-varma <siri.varma@outlook.com>
1 parent 1e2f562 commit 3c61bc2

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

examples/src/main/java/io/dapr/examples/workflows/childworkflow/DemoChildWorkflow.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
package io.dapr.examples.workflows.childworkflow;
1515

16-
import io.dapr.durabletask.interruption.OrchestratorBlockedException;
1716
import io.dapr.workflows.Workflow;
1817
import io.dapr.workflows.WorkflowStub;
1918
import io.dapr.workflows.WorkflowTaskOptions;

sdk-workflows/src/test/java/io/dapr/workflows/DefaultWorkflowContextTest.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)