Skip to content

Commit

Permalink
Fix more tests requiring dapr-api-token
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
  • Loading branch information
artursouza committed Oct 14, 2024
1 parent 9a0d0d7 commit ecd3f9b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
package io.dapr.it.actors.services.springboot;

import io.dapr.actors.runtime.ActorRuntime;
import io.dapr.it.DaprRunConfig;
import io.dapr.serializer.DefaultObjectSerializer;

import java.time.Duration;

@DaprRunConfig(enableDaprApiToken = false)
public class StatefulActorService {

public static final String SUCCESS_MESSAGE = "dapr initialized. Status: Running";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
package io.dapr.it.state;

import com.google.protobuf.ByteString;
import io.dapr.client.DaprClientBuilder;
import io.dapr.config.Properties;
import io.dapr.internal.grpc.DaprClientGrpcInterceptors;
import io.dapr.v1.CommonProtos.StateItem;
import io.dapr.v1.DaprGrpc;
import io.dapr.v1.DaprGrpc.DaprBlockingStub;
Expand All @@ -38,8 +40,11 @@ public static void main(String[] args) {

// If port string is not valid, it will throw an exception.
int grpcPortInt = Integer.parseInt(grpcPort);
ManagedChannel channel = ManagedChannelBuilder.forAddress(Properties.SIDECAR_IP.get(), grpcPortInt).usePlaintext().build();
DaprBlockingStub client = DaprGrpc.newBlockingStub(channel);
ManagedChannel channel = ManagedChannelBuilder.forAddress(
Properties.SIDECAR_IP.get(), grpcPortInt).usePlaintext().build();
DaprClientGrpcInterceptors interceptors = new DaprClientGrpcInterceptors(
Properties.API_TOKEN.get(), null);
DaprBlockingStub client = interceptors.intercept(DaprGrpc.newBlockingStub(channel));

String key = "mykey";
// First, write key-value pair.
Expand Down

0 comments on commit ecd3f9b

Please sign in to comment.