File tree Expand file tree Collapse file tree 5 files changed +17
-17
lines changed
main/java/io/dapr/workflows/runtime
test/java/io/dapr/workflows/runtime Expand file tree Collapse file tree 5 files changed +17
-17
lines changed Original file line number Diff line number Diff line change 2222/**
2323 * Wrapper for Durable Task Framework task activity factory.
2424 */
25- public class ActivityWrapper <T extends WorkflowActivity > implements TaskActivityFactory {
25+ public class WorkflowActivityWrapper <T extends WorkflowActivity > implements TaskActivityFactory {
2626 private final Constructor <T > activityConstructor ;
2727 private final String name ;
2828
2929 /**
30- * Constructor for ActivityWrapper .
30+ * Constructor for WorkflowActivityWrapper .
3131 *
3232 * @param clazz Class of the activity to wrap.
3333 */
34- public ActivityWrapper (Class <T > clazz ) {
34+ public WorkflowActivityWrapper (Class <T > clazz ) {
3535 this .name = clazz .getCanonicalName ();
3636 try {
3737 this .activityConstructor = clazz .getDeclaredConstructor ();
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ public WorkflowRuntime build() {
9191 * @return the WorkflowRuntimeBuilder
9292 */
9393 public <T extends Workflow > WorkflowRuntimeBuilder registerWorkflow (Class <T > clazz ) {
94- this .builder .addOrchestration (new OrchestratorWrapper <>(clazz ));
94+ this .builder .addOrchestration (new WorkflowWrapper <>(clazz ));
9595 this .workflowSet .add (clazz .getCanonicalName ());
9696 this .workflows .add (clazz .getSimpleName ());
9797
@@ -108,7 +108,7 @@ public <T extends Workflow> WorkflowRuntimeBuilder registerWorkflow(Class<T> cla
108108 * @return the WorkflowRuntimeBuilder
109109 */
110110 public <T extends WorkflowActivity > WorkflowRuntimeBuilder registerActivity (Class <T > clazz ) {
111- this .builder .addActivity (new ActivityWrapper <>(clazz ));
111+ this .builder .addActivity (new WorkflowActivityWrapper <>(clazz ));
112112 this .activitySet .add (clazz .getCanonicalName ());
113113 this .activities .add (clazz .getSimpleName ());
114114
Original file line number Diff line number Diff line change 2525/**
2626 * Wrapper for Durable Task Framework orchestration factory.
2727 */
28- class OrchestratorWrapper <T extends Workflow > implements TaskOrchestrationFactory {
28+ class WorkflowWrapper <T extends Workflow > implements TaskOrchestrationFactory {
2929 private final Constructor <T > workflowConstructor ;
3030 private final String name ;
3131
32- public OrchestratorWrapper (Class <T > clazz ) {
32+ public WorkflowWrapper (Class <T > clazz ) {
3333 this .name = clazz .getCanonicalName ();
3434 try {
3535 this .workflowConstructor = clazz .getDeclaredConstructor ();
Original file line number Diff line number Diff line change 1010import static org .mockito .Mockito .when ;
1111
1212
13- public class ActivityWrapperTest {
13+ public class WorkflowActivityWrapperTest {
1414 public static class TestActivity implements WorkflowActivity {
1515 @ Override
1616 public Object run (WorkflowActivityContext ctx ) {
@@ -21,19 +21,19 @@ public Object run(WorkflowActivityContext ctx) {
2121
2222 @ Test
2323 public void getName () throws NoSuchMethodException {
24- ActivityWrapper < ActivityWrapperTest . TestActivity > wrapper = new ActivityWrapper <>(
25- ActivityWrapperTest .TestActivity .class );
24+ WorkflowActivityWrapper < TestActivity > wrapper = new WorkflowActivityWrapper <>(
25+ WorkflowActivityWrapperTest .TestActivity .class );
2626 Assert .assertEquals (
27- "io.dapr.workflows.runtime.ActivityWrapperTest .TestActivity" ,
27+ "io.dapr.workflows.runtime.WorkflowActivityWrapperTest .TestActivity" ,
2828 wrapper .getName ()
2929 );
3030 }
3131
3232 @ Test
3333 public void createWithClass () throws NoSuchMethodException {
3434 TaskActivityContext mockContext = mock (TaskActivityContext .class );
35- ActivityWrapper < ActivityWrapperTest . TestActivity > wrapper = new ActivityWrapper <>(
36- ActivityWrapperTest .TestActivity .class );
35+ WorkflowActivityWrapper < TestActivity > wrapper = new WorkflowActivityWrapper <>(
36+ WorkflowActivityWrapperTest .TestActivity .class );
3737 when (mockContext .getInput (String .class )).thenReturn ("Hello" );
3838 when (mockContext .getName ()).thenReturn ("TestActivityContext" );
3939 Object result = wrapper .create ().run (mockContext );
Original file line number Diff line number Diff line change 2626import static org .mockito .Mockito .verify ;
2727import static org .mockito .Mockito .when ;
2828
29- public class OrchestratorWrapperTest {
29+ public class WorkflowWrapperTest {
3030 public static class TestWorkflow extends Workflow {
3131 @ Override
3232 public WorkflowStub create () {
@@ -36,17 +36,17 @@ public WorkflowStub create() {
3636
3737 @ Test
3838 public void getName () {
39- OrchestratorWrapper <TestWorkflow > wrapper = new OrchestratorWrapper <>(TestWorkflow .class );
39+ WorkflowWrapper <TestWorkflow > wrapper = new WorkflowWrapper <>(TestWorkflow .class );
4040 Assertions .assertEquals (
41- "io.dapr.workflows.runtime.OrchestratorWrapperTest .TestWorkflow" ,
41+ "io.dapr.workflows.runtime.WorkflowWrapperTest .TestWorkflow" ,
4242 wrapper .getName ()
4343 );
4444 }
4545
4646 @ Test
4747 public void createWithClass () {
4848 TaskOrchestrationContext mockContext = mock (TaskOrchestrationContext .class );
49- OrchestratorWrapper <TestWorkflow > wrapper = new OrchestratorWrapper <>(TestWorkflow .class );
49+ WorkflowWrapper <TestWorkflow > wrapper = new WorkflowWrapper <>(TestWorkflow .class );
5050 when (mockContext .getInstanceId ()).thenReturn ("uuid" );
5151 wrapper .create ().run (mockContext );
5252 verify (mockContext , times (1 )).getInstanceId ();
You can’t perform that action at this time.
0 commit comments