diff --git a/core/src/test/java/io/temporal/samples/nexus/caller/CallerWorkflowJunit5MockTest.java b/core/src/test/java/io/temporal/samples/nexus/caller/CallerWorkflowJunit5MockTest.java index ca038ee0..2ba04230 100644 --- a/core/src/test/java/io/temporal/samples/nexus/caller/CallerWorkflowJunit5MockTest.java +++ b/core/src/test/java/io/temporal/samples/nexus/caller/CallerWorkflowJunit5MockTest.java @@ -16,6 +16,7 @@ // This is an example of how to unit test Nexus services in JUnit5. The handlers are mocked, // so that the caller classes interact with the mocks and not the handler classes themselves. +// @@@SNIPSTART java-nexus-sample-junit5-mock public class CallerWorkflowJunit5MockTest { // Sync Nexus operations run inline in the handler thread — there is no backing workflow to @@ -77,3 +78,5 @@ public void testEchoWorkflow( testEnv.shutdown(); } } + +// @@@SNIPEND diff --git a/core/src/test/java/io/temporal/samples/nexus/caller/CallerWorkflowMockTest.java b/core/src/test/java/io/temporal/samples/nexus/caller/CallerWorkflowMockTest.java index c899713a..d6b793ff 100644 --- a/core/src/test/java/io/temporal/samples/nexus/caller/CallerWorkflowMockTest.java +++ b/core/src/test/java/io/temporal/samples/nexus/caller/CallerWorkflowMockTest.java @@ -17,6 +17,7 @@ // This is an example of how to unit test Nexus services in JUnit4. The handlers are mocked, // so that the caller classes interact with the mocks and not the handler classes themselves. +// @@@SNIPSTART java-nexus-sample-junit4-mock public class CallerWorkflowMockTest { // Inject a mock EchoClient so sync Nexus operations can be stubbed per test. @@ -90,3 +91,5 @@ public void testEchoWorkflow() { testWorkflowRule.getTestEnvironment().shutdown(); } } + +// @@@SNIPEND diff --git a/core/src/test/java/io/temporal/samples/nexus/caller/NexusServiceJunit5Test.java b/core/src/test/java/io/temporal/samples/nexus/caller/NexusServiceJunit5Test.java index c5fd578c..fe8a8b8c 100644 --- a/core/src/test/java/io/temporal/samples/nexus/caller/NexusServiceJunit5Test.java +++ b/core/src/test/java/io/temporal/samples/nexus/caller/NexusServiceJunit5Test.java @@ -18,6 +18,8 @@ // This is the path to take when you don't have access to the service implementation so // cannot mock it. Since the SampleNexusService itself is mocked, // no handlers need to be set up or mocked. + +// @@@SNIPSTART java-nexus-service-sample-junit4-mock public class NexusServiceJunit5Test { private final SampleNexusService mockNexusService = mock(SampleNexusService.class); @@ -103,3 +105,5 @@ public void testEchoWorkflow( verifyNoMoreInteractions(mockNexusService); } } + +// @@@SNIPEND diff --git a/core/src/test/java/io/temporal/samples/nexus/caller/NexusServiceMockTest.java b/core/src/test/java/io/temporal/samples/nexus/caller/NexusServiceMockTest.java index c2264ec6..8dafc638 100644 --- a/core/src/test/java/io/temporal/samples/nexus/caller/NexusServiceMockTest.java +++ b/core/src/test/java/io/temporal/samples/nexus/caller/NexusServiceMockTest.java @@ -17,6 +17,8 @@ // This is the path to take when you don't have access to the service implementation so // cannot mock it. Since the SampleNexusService itself is mocked, // no handlers need to be set up or mocked. + +// @@@SNIPSTART java-nexus-service-sample-junit4-mock public class NexusServiceMockTest { private final SampleNexusService mockNexusService = mock(SampleNexusService.class); @@ -102,3 +104,5 @@ public void testEchoCallerWithMockedService() { verifyNoMoreInteractions(mockNexusService); } } + +// @@@SNIPEND