|
15 | 15 | */
|
16 | 16 | package com.uber.cadence.testing;
|
17 | 17 |
|
| 18 | +import com.google.common.annotations.VisibleForTesting; |
18 | 19 | import com.uber.cadence.internal.shadowing.ReplayWorkflowActivity;
|
19 | 20 | import com.uber.cadence.internal.shadowing.ReplayWorkflowActivityImpl;
|
20 | 21 | import com.uber.cadence.internal.shadowing.ReplayWorkflowActivityResult;
|
|
26 | 27 | import com.uber.cadence.serviceclient.IWorkflowService;
|
27 | 28 | import com.uber.cadence.shadower.Mode;
|
28 | 29 | import com.uber.cadence.worker.ShadowingOptions;
|
| 30 | +import com.uber.cadence.worker.WorkflowImplementationOptions; |
| 31 | +import com.uber.cadence.workflow.Functions; |
29 | 32 | import com.uber.m3.tally.NoopScope;
|
30 | 33 | import com.uber.m3.tally.Scope;
|
31 | 34 | import java.time.Duration;
|
@@ -53,6 +56,7 @@ public WorkflowShadower(
|
53 | 56 | new ReplayWorkflowActivityImpl(service, metricsScope, taskList));
|
54 | 57 | }
|
55 | 58 |
|
| 59 | + @VisibleForTesting |
56 | 60 | public WorkflowShadower(
|
57 | 61 | ShadowingOptions options,
|
58 | 62 | ScanWorkflowActivity scanWorkflow,
|
@@ -114,6 +118,28 @@ public void run() throws Throwable {
|
114 | 118 | } while (nextPageToken != null && options.getShadowMode() == Mode.Normal);
|
115 | 119 | }
|
116 | 120 |
|
| 121 | + public void registerWorkflowImplementationTypes(Class<?>... workflowImplementationClasses) { |
| 122 | + replayWorkflow.registerWorkflowImplementationTypes(workflowImplementationClasses); |
| 123 | + } |
| 124 | + |
| 125 | + public void registerWorkflowImplementationTypes( |
| 126 | + WorkflowImplementationOptions options, Class<?>... workflowImplementationClasses) { |
| 127 | + replayWorkflow.registerWorkflowImplementationTypesWithOptions( |
| 128 | + options, workflowImplementationClasses); |
| 129 | + } |
| 130 | + |
| 131 | + public <R> void addWorkflowImplementationFactory( |
| 132 | + WorkflowImplementationOptions options, |
| 133 | + Class<R> workflowInterface, |
| 134 | + Functions.Func<R> factory) { |
| 135 | + replayWorkflow.addWorkflowImplementationFactoryWithOptions(options, workflowInterface, factory); |
| 136 | + } |
| 137 | + |
| 138 | + public <R> void addWorkflowImplementationFactory( |
| 139 | + Class<R> workflowInterface, Functions.Func<R> factory) { |
| 140 | + replayWorkflow.addWorkflowImplementationFactory(workflowInterface, factory); |
| 141 | + } |
| 142 | + |
117 | 143 | private ShadowingOptions validateShadowingOptions(ShadowingOptions options) {
|
118 | 144 | Objects.requireNonNull(options);
|
119 | 145 |
|
|
0 commit comments