Skip to content

Commit 4152393

Browse files
Update ActorStateIT.java
Fix compilation errors
1 parent d9e8445 commit 4152393

File tree

1 file changed

+30
-10
lines changed

1 file changed

+30
-10
lines changed

Diff for: sdk-tests/src/test/java/io/dapr/it/actors/ActorStateIT.java

+30-10
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,19 @@
1616
import io.dapr.actors.ActorId;
1717
import io.dapr.actors.client.ActorProxy;
1818
import io.dapr.actors.client.ActorProxyBuilder;
19+
import io.dapr.it.AppRun;
1920
import io.dapr.it.BaseIT;
2021
import io.dapr.it.DaprRun;
2122
import io.dapr.it.actors.services.springboot.StatefulActor;
2223
import io.dapr.it.actors.services.springboot.StatefulActorService;
23-
import org.junit.jupiter.api.Test;
24+
import org.junit.jupiter.params.ParameterizedTest;
25+
import org.junit.jupiter.params.provider.Arguments;
26+
import org.junit.jupiter.params.provider.MethodSource;
2427
import org.slf4j.Logger;
2528
import org.slf4j.LoggerFactory;
2629

30+
import java.util.stream.Stream;
31+
2732
import static io.dapr.it.Retry.callWithRetry;
2833
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
2934
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -33,16 +38,30 @@ public class ActorStateIT extends BaseIT {
3338

3439
private static Logger logger = LoggerFactory.getLogger(ActorStateIT.class);
3540

36-
@Test
37-
public void writeReadState() throws Exception {
41+
/**
42+
* Parameters for this test.
43+
* Param #1: useGrpc.
44+
* @return Collection of parameter tuples.
45+
*/
46+
public static Stream<Arguments> data() {
47+
return Stream.of(
48+
Arguments.of(AppRun.AppProtocol.HTTP ),
49+
Arguments.of(AppRun.AppProtocol.GRPC )
50+
);
51+
}
52+
53+
@ParameterizedTest
54+
@MethodSource("data")
55+
public void writeReadState(AppRun.AppProtocol serviceAppProtocol) throws Exception {
3856
logger.debug("Starting actor runtime ...");
3957
// The call below will fail if service cannot start successfully.
4058
DaprRun run = startDaprApp(
41-
this.getClass().getSimpleName(),
42-
StatefulActorService.SUCCESS_MESSAGE,
43-
StatefulActorService.class,
44-
true,
45-
60000);
59+
this.getClass().getSimpleName(),
60+
StatefulActorService.SUCCESS_MESSAGE,
61+
StatefulActorService.class,
62+
true,
63+
60000,
64+
serviceAppProtocol);
4665

4766
String message = "This is a message to be saved and retrieved.";
4867
String name = "Jon Doe";
@@ -134,7 +153,8 @@ public void writeReadState() throws Exception {
134153
StatefulActorService.SUCCESS_MESSAGE,
135154
StatefulActorService.class,
136155
true,
137-
60000);
156+
60000,
157+
serviceAppProtocol);
138158

139159
// Need new proxy builder because the proxy builder holds the channel.
140160
proxyBuilder = new ActorProxyBuilder(actorType, ActorProxy.class, deferClose(run2.newActorClient()));
@@ -219,7 +239,7 @@ public void stateTTL(AppRun.AppProtocol serviceAppProtocol) throws Exception {
219239
Thread.sleep(10000);
220240

221241
logger.debug("Stopping service ...");
222-
runtime.stop();
242+
run.stop();
223243

224244
logger.debug("Starting service ...");
225245
DaprRun run2 = startDaprApp(

0 commit comments

Comments
 (0)