Skip to content

Commit 70c21bb

Browse files
committed
Formatting changes from Spotless
1 parent 47da04e commit 70c21bb

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

core/src/test/java/io/temporal/samples/nexus/caller/CallerWorkflowJunit5MockTest.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package io.temporal.samples.nexus.caller;
22

3+
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
import static org.mockito.Mockito.*;
5+
36
import io.temporal.samples.nexus.handler.EchoHandler;
47
import io.temporal.samples.nexus.handler.HelloHandlerWorkflow;
58
import io.temporal.samples.nexus.handler.NexusServiceImpl;
@@ -10,9 +13,6 @@
1013
import org.junit.jupiter.api.Test;
1114
import org.junit.jupiter.api.extension.RegisterExtension;
1215

13-
import static org.junit.jupiter.api.Assertions.assertEquals;
14-
import static org.mockito.Mockito.*;
15-
1616
public class CallerWorkflowJunit5MockTest {
1717

1818
// Sync Nexus operations run inline in the handler thread — there is no backing workflow to
@@ -23,23 +23,24 @@ public class CallerWorkflowJunit5MockTest {
2323
public static final TestWorkflowExtension testWorkflowExtension =
2424
TestWorkflowExtension.newBuilder()
2525
// If a Nexus service is registered as part of the test as in the following line of code,
26-
// the TestWorkflowExtension will, by default, automatically create a Nexus service endpoint
27-
// and workflows registered as part of the TestWorkflowExtension will
26+
// the TestWorkflowExtension will, by default, automatically create a Nexus service
27+
// endpoint and workflows registered as part of the TestWorkflowExtension will
2828
// automatically inherit the endpoint if none is set.
2929
.setNexusServiceImplementation(new NexusServiceImpl(mockEchoHandler))
3030
// The Echo Nexus handler service just makes a call to a class, so no extra setup is
3131
// needed. But the Hello Nexus service needs a worker for both the caller and handler
3232
// in order to run, and the Echo Nexus caller service needs a worker.
3333
//
34-
// registerWorkflowImplementationTypes will take the classes given and create workers for them,
35-
// enabling workflows to run.
34+
// registerWorkflowImplementationTypes will take the classes given and create workers for
35+
// them, enabling workflows to run.
3636
.registerWorkflowImplementationTypes(
3737
HelloCallerWorkflowImpl.class, EchoCallerWorkflowImpl.class)
3838
.setDoNotStart(true)
3939
.build();
4040

4141
@Test
42-
public void testHelloWorkflow(TestWorkflowEnvironment testEnv, Worker worker, HelloCallerWorkflow workflow) {
42+
public void testHelloWorkflow(
43+
TestWorkflowEnvironment testEnv, Worker worker, HelloCallerWorkflow workflow) {
4344
// Workflows started by a Nexus service can be mocked just like any other workflow
4445
worker.registerWorkflowImplementationFactory(
4546
HelloHandlerWorkflow.class,
@@ -59,7 +60,8 @@ public void testHelloWorkflow(TestWorkflowEnvironment testEnv, Worker worker, He
5960
}
6061

6162
@Test
62-
public void testEchoWorkflow(TestWorkflowEnvironment testEnv, Worker worker, EchoCallerWorkflow workflow) {
63+
public void testEchoWorkflow(
64+
TestWorkflowEnvironment testEnv, Worker worker, EchoCallerWorkflow workflow) {
6365
// Sync Nexus operations run inline in the handler thread — there is no backing workflow to
6466
// register a factory for. Instead, stub the injected EchoHandler dependency directly.
6567
when(mockEchoHandler.echo(any())).thenReturn(new NexusService.EchoOutput("mocked echo"));

core/src/test/java/io/temporal/samples/nexus/caller/CallerWorkflowJunit5Test.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ public class CallerWorkflowJunit5Test {
1717
public static final TestWorkflowExtension testWorkflowExtension =
1818
TestWorkflowExtension.newBuilder()
1919
// If a Nexus service is registered as part of the test as in the following line of code,
20-
// the TestWorkflowExtension will, by default, automatically create a Nexus service endpoint
21-
// and workflows registered as part of the TestWorkflowExtension will
20+
// the TestWorkflowExtension will, by default, automatically create a Nexus service
21+
// endpoint and workflows registered as part of the TestWorkflowExtension will
2222
// automatically inherit the endpoint if none is set.
2323
.setNexusServiceImplementation(new NexusServiceImpl())
2424
// The Echo Nexus handler service just makes a call to a class, so no extra setup is
2525
// needed. But the Hello Nexus service needs a worker for both the caller and handler
2626
// in order to run, and the Echo Nexus caller service needs a worker.
2727
//
28-
// registerWorkflowImplementationTypes will take the classes given and create workers for them,
29-
// enabling workflows to run.
28+
// registerWorkflowImplementationTypes will take the classes given and create workers for
29+
// them, enabling workflows to run.
3030
.registerWorkflowImplementationTypes(
3131
HelloCallerWorkflowImpl.class,
3232
HelloHandlerWorkflowImpl.class,
@@ -38,14 +38,16 @@ public class CallerWorkflowJunit5Test {
3838
// The TestWorkflowExtension extension in the Temporal testing library creates the
3939
// arguments to the test cases and initializes them from the extension setup call above.
4040
@Test
41-
public void testHelloWorkflow(TestWorkflowEnvironment testEnv, Worker worker, HelloCallerWorkflow workflow) {
41+
public void testHelloWorkflow(
42+
TestWorkflowEnvironment testEnv, Worker worker, HelloCallerWorkflow workflow) {
4243
// Execute a workflow waiting for it to complete.
4344
String greeting = workflow.hello("World", NexusService.Language.EN);
4445
assertEquals("Hello World 👋", greeting);
4546
}
4647

4748
@Test
48-
public void testEchoWorkflow(TestWorkflowEnvironment testEnv, Worker worker, EchoCallerWorkflow workflow) {
49+
public void testEchoWorkflow(
50+
TestWorkflowEnvironment testEnv, Worker worker, EchoCallerWorkflow workflow) {
4951
// Execute a workflow waiting for it to complete.
5052
String greeting = workflow.echo("Hello");
5153
assertEquals("Hello", greeting);

0 commit comments

Comments
 (0)