File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
sdk-tests/src/test/java/io/dapr/it
actors/services/springboot Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 1414package io .dapr .it .actors .services .springboot ;
1515
1616import io .dapr .actors .runtime .ActorRuntime ;
17+ import io .dapr .it .DaprRunConfig ;
1718import io .dapr .serializer .DefaultObjectSerializer ;
1819
1920import java .time .Duration ;
2021
22+ @ DaprRunConfig (enableDaprApiToken = false )
2123public class StatefulActorService {
2224
2325 public static final String SUCCESS_MESSAGE = "dapr initialized. Status: Running" ;
Original file line number Diff line number Diff line change 1414package io .dapr .it .state ;
1515
1616import com .google .protobuf .ByteString ;
17+ import io .dapr .client .DaprClientBuilder ;
1718import io .dapr .config .Properties ;
19+ import io .dapr .internal .grpc .DaprClientGrpcInterceptors ;
1820import io .dapr .v1 .CommonProtos .StateItem ;
1921import io .dapr .v1 .DaprGrpc ;
2022import io .dapr .v1 .DaprGrpc .DaprBlockingStub ;
@@ -38,8 +40,11 @@ public static void main(String[] args) {
3840
3941 // If port string is not valid, it will throw an exception.
4042 int grpcPortInt = Integer .parseInt (grpcPort );
41- ManagedChannel channel = ManagedChannelBuilder .forAddress (Properties .SIDECAR_IP .get (), grpcPortInt ).usePlaintext ().build ();
42- DaprBlockingStub client = DaprGrpc .newBlockingStub (channel );
43+ ManagedChannel channel = ManagedChannelBuilder .forAddress (
44+ Properties .SIDECAR_IP .get (), grpcPortInt ).usePlaintext ().build ();
45+ DaprClientGrpcInterceptors interceptors = new DaprClientGrpcInterceptors (
46+ Properties .API_TOKEN .get (), null );
47+ DaprBlockingStub client = interceptors .intercept (DaprGrpc .newBlockingStub (channel ));
4348
4449 String key = "mykey" ;
4550 // First, write key-value pair.
You can’t perform that action at this time.
0 commit comments