@@ -20,8 +20,8 @@ import { CommunicationProtocolEnum, DaprClient, LogLevel } from "../../../src";
20
20
import { SubscribeConfigurationResponse } from "../../../src/types/configuration/SubscribeConfigurationResponse" ;
21
21
import * as DockerUtils from "../../utils/DockerUtil" ;
22
22
import { DaprClient as DaprClientGrpc } from "../../../src/proto/dapr/proto/runtime/v1/dapr_grpc_pb" ;
23
- import { Empty } from "google-protobuf/google/protobuf/empty_pb" ;
24
23
import { NextCall } from "@grpc/grpc-js/build/src/client-interceptors" ;
24
+ import { GetMetadataRequest } from "../../../src/proto/dapr/proto/runtime/v1/dapr_pb" ;
25
25
26
26
const daprHost = "localhost" ;
27
27
const daprPort = "50000" ; // Dapr Sidecar Port of this Example Server
@@ -76,7 +76,7 @@ describe("grpc/client", () => {
76
76
interceptors : [ mockInterceptor ] ,
77
77
} ) ;
78
78
79
- await new Promise ( ( resolve ) => clientProxy . getMetadata ( new Empty ( ) , resolve ) ) ;
79
+ await new Promise ( ( resolve ) => clientProxy . getMetadata ( new GetMetadataRequest ( ) , resolve ) ) ;
80
80
81
81
expect ( mockInterceptor . mock . calls . length ) . toBe ( 1 ) ;
82
82
expect ( mockMetadataRes . get ( "dapr-app-id" ) [ 0 ] ) . toBe ( "test-suite" ) ;
@@ -104,7 +104,7 @@ describe("grpc/client", () => {
104
104
interceptors : [ mockInterceptor ] ,
105
105
} ) ;
106
106
107
- await new Promise ( ( resolve ) => clientProxy . getMetadata ( new Empty ( ) , resolve ) ) ;
107
+ await new Promise ( ( resolve ) => clientProxy . getMetadata ( new GetMetadataRequest ( ) , resolve ) ) ;
108
108
109
109
expect ( mockInterceptor . mock . calls . length ) . toBe ( 1 ) ;
110
110
expect ( mockMetadataRes . get ( "dapr-app-id" ) [ 0 ] ) . toBe ( process . env . APP_ID ) ;
@@ -362,13 +362,13 @@ describe("grpc/client", () => {
362
362
expect ( config . items [ "myconfigkey3" ] . value == "key3_initialvalue" ) ;
363
363
} ) ;
364
364
365
- it ( "should be able to get the configuration items with metadata" , async ( ) => {
366
- const conf = await client . configuration . get ( "config-redis" , [ "myconfigkey1" ] , {
367
- hello : "world" ,
368
- } ) ;
369
-
370
- expect ( conf . items [ "myconfigkey1" ] . metadata ) . toHaveProperty ( "hello" ) ;
371
- } ) ;
365
+ // todo: enable this once we have a component to test this with.
366
+ // Redis does not support metadata, PG and Azure App Config do.
367
+ // it("should be able to get the configuration items with metadata", async () => {
368
+ // const conf = await client.configuration.get("config-redis", ["myconfigkey1"], {
369
+ // hello: "world",
370
+ // } );
371
+ // });
372
372
373
373
it ( "should be able to subscribe to configuration item changes on all keys" , async ( ) => {
374
374
const m = jest . fn ( async ( _res : SubscribeConfigurationResponse ) => {
0 commit comments