33import static org .junit .jupiter .api .Assertions .assertEquals ;
44import static org .mockito .Mockito .*;
55
6- import io .temporal .samples .nexus .handler .EchoHandler ;
6+ import io .temporal .samples .nexus .handler .EchoClient ;
77import io .temporal .samples .nexus .handler .HelloHandlerWorkflow ;
88import io .temporal .samples .nexus .handler .NexusServiceImpl ;
99import io .temporal .samples .nexus .service .NexusService ;
@@ -20,7 +20,7 @@ public class CallerWorkflowJunit5MockTest {
2020
2121 // Sync Nexus operations run inline in the handler thread — there is no backing workflow to
2222 // register a factory for. To mock one, inject a mock dependency into the service implementation.
23- private static final EchoHandler mockEchoHandler = mock (EchoHandler .class );
23+ private static final EchoClient mockEchoClient = mock (EchoClient .class );
2424
2525 @ RegisterExtension
2626 public static final TestWorkflowExtension testWorkflowExtension =
@@ -29,7 +29,7 @@ public class CallerWorkflowJunit5MockTest {
2929 // the TestWorkflowExtension will, by default, automatically create a Nexus service
3030 // endpoint and workflows registered as part of the TestWorkflowExtension will
3131 // automatically inherit the endpoint if none is set.
32- .setNexusServiceImplementation (new NexusServiceImpl (mockEchoHandler ))
32+ .setNexusServiceImplementation (new NexusServiceImpl (mockEchoClient ))
3333 // The Echo Nexus handler service just makes a call to a class, so no extra setup is
3434 // needed. But the Hello Nexus service needs a worker for both the caller and handler
3535 // in order to run, and the Echo Nexus caller service needs a worker.
@@ -66,8 +66,8 @@ public void testHelloWorkflow(
6666 public void testEchoWorkflow (
6767 TestWorkflowEnvironment testEnv , Worker worker , EchoCallerWorkflow workflow ) {
6868 // Sync Nexus operations run inline in the handler thread — there is no backing workflow to
69- // register a factory for. Instead, stub the injected EchoHandler dependency directly.
70- when (mockEchoHandler .echo (any ())).thenReturn (new NexusService .EchoOutput ("mocked echo" ));
69+ // register a factory for. Instead, stub the injected EchoClient dependency directly.
70+ when (mockEchoClient .echo (any ())).thenReturn (new NexusService .EchoOutput ("mocked echo" ));
7171 testEnv .start ();
7272
7373 // Execute a workflow waiting for it to complete.
0 commit comments