Skip to content

Commit bc579e3

Browse files
committed
chore: Fix bug, return type is required
Signed-off-by: Javier Aliaga <[email protected]>
1 parent 768aa2e commit bc579e3

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

durabletask-client/src/main/java/io/dapr/durabletask/TaskOrchestrationContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ default Task<Void> callSubOrchestrator(String name) {
411411
* @return a new {@link Task} that completes when the sub-orchestration completes or fails
412412
*/
413413
default Task<Void> callSubOrchestrator(String name, Object input) {
414-
return this.callSubOrchestrator(name, input, null);
414+
return this.callSubOrchestrator(name, input, Void.class);
415415
}
416416

417417
/**

durabletask-client/src/main/java/io/dapr/durabletask/TaskOrchestrationExecutor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public TaskOrchestratorResult execute(List<OrchestratorService.HistoryEvent> pas
103103
} catch (Exception e) {
104104
// The orchestrator threw an unhandled exception - fail it
105105
// TODO: What's the right way to log this?
106-
logger.warning("The orchestrator failed with an unhandled exception: " + e.toString());
106+
logger.warning("The orchestrator failed with an unhandled exception: " + e);
107107
context.fail(new FailureDetails(e));
108108
}
109109

sdk-workflows/src/main/java/io/dapr/workflows/WorkflowContext.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.slf4j.Logger;
2121

2222
import javax.annotation.Nullable;
23-
2423
import java.time.Duration;
2524
import java.time.Instant;
2625
import java.time.ZonedDateTime;
@@ -383,7 +382,7 @@ default Task<Void> callChildWorkflow(String name) {
383382
* @return a new {@link Task} that completes when the child-workflow completes or fails
384383
*/
385384
default Task<Void> callChildWorkflow(String name, Object input) {
386-
return this.callChildWorkflow(name, input, null);
385+
return this.callChildWorkflow(name, input, Void.class);
387386
}
388387

389388
/**

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@
3838
import static org.junit.jupiter.api.Assertions.assertThrows;
3939
import static org.mockito.ArgumentMatchers.any;
4040
import static org.mockito.ArgumentMatchers.eq;
41-
import static org.mockito.Mockito.*;
41+
import static org.mockito.Mockito.mock;
42+
import static org.mockito.Mockito.spy;
43+
import static org.mockito.Mockito.times;
44+
import static org.mockito.Mockito.verify;
45+
import static org.mockito.Mockito.when;
4246

4347
public class DefaultWorkflowContextTest {
4448
private DefaultWorkflowContext context;
@@ -284,7 +288,7 @@ public void callChildWorkflowWithName() {
284288
String expectedName = "TestActivity";
285289

286290
context.callChildWorkflow(expectedName);
287-
verify(mockInnerContext, times(1)).callSubOrchestrator(expectedName, null, null, null, null);
291+
verify(mockInnerContext, times(1)).callSubOrchestrator(expectedName, null, null, null, Void.class);
288292
}
289293

290294
@Test

sdk-workflows/src/test/java/io/dapr/workflows/runtime/DefaultWorkflowActivityContextTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
import org.junit.jupiter.api.Test;
66
import org.slf4j.Logger;
77

8-
import static org.junit.jupiter.api.Assertions.*;
8+
import static org.junit.jupiter.api.Assertions.assertEquals;
9+
import static org.junit.jupiter.api.Assertions.assertNotNull;
10+
import static org.junit.jupiter.api.Assertions.assertThrows;
911
import static org.mockito.ArgumentMatchers.any;
1012
import static org.mockito.Mockito.mock;
1113
import static org.mockito.Mockito.when;
@@ -21,6 +23,7 @@ void shouldSuccessfullyCreateContextAndReturnCorrectValuesForAllMethods() {
2123
when(mockInnerContext.getName()).thenReturn("TestActivity");
2224
when(mockInnerContext.getInput(any())).thenReturn("TestInput");
2325
when(mockInnerContext.getTaskExecutionId()).thenReturn("TestExecutionId");
26+
when(mockInnerContext.getTraceParent()).thenReturn("00244654132154564654");
2427

2528
assertNotNull(context.getLogger());
2629
assertEquals("TestActivity", context.getName());
@@ -29,6 +32,7 @@ void shouldSuccessfullyCreateContextAndReturnCorrectValuesForAllMethods() {
2932

3033
assertEquals("TestInput", input);
3134
assertEquals("TestExecutionId", context.getTaskExecutionId());
35+
assertEquals("00244654132154564654", context.getTraceParent());
3236
}
3337

3438
@Test

0 commit comments

Comments
 (0)