Skip to content

Commit a3a891d

Browse files
committed
Fix things
Signed-off-by: siri-varma <siri.varma@outlook.com>
1 parent 3c61bc2 commit a3a891d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,4 +357,23 @@ public void workflowRetryPolicyRetryTimeoutValueShouldHaveRightValueWhenBeingSet
357357

358358
assertEquals(Duration.ofSeconds(10), taskOptions.getRetryPolicy().getRetryTimeout());
359359
}
360+
361+
@Test
362+
public void workflowRetryPolicyRetryThrowIllegalArgumentWhenNullRetryTimeoutIsSet() {
363+
assertThrows(IllegalArgumentException.class, () ->
364+
WorkflowTaskRetryPolicy.newBuilder()
365+
.setMaxNumberOfAttempts(1)
366+
.setFirstRetryInterval(Duration.ofSeconds(10))
367+
.setRetryTimeout(null)
368+
.build());
369+
}
370+
371+
@Test
372+
public void workflowRetryPolicyRetryThrowIllegalArgumentWhenRetryTimeoutIsLessThanMaxRetryInterval() {
373+
assertThrows(IllegalArgumentException.class, () -> WorkflowTaskRetryPolicy.newBuilder()
374+
.setMaxNumberOfAttempts(1)
375+
.setFirstRetryInterval(Duration.ofSeconds(10))
376+
.setRetryTimeout(Duration.ofSeconds(9))
377+
.build());
378+
}
360379
}

0 commit comments

Comments
 (0)