Skip to content

Commit

Permalink
fix: add null request for bi_di stream call (#1066)
Browse files Browse the repository at this point in the history
* fix: add null request for bi_di stream call

* update the unit test for bidi stream
  • Loading branch information
summer-ji-eng committed Dec 6, 2021
1 parent b56c01f commit 1149cb1
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ export class EchoClient {
options?: CallOptions):
gax.CancellableStream {
this.initialize();
return this.innerApiCalls.chat(options);
return this.innerApiCalls.chat(null, options);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ export class MessagingClient {
options?: CallOptions):
gax.CancellableStream {
this.initialize();
return this.innerApiCalls.connect(options);
return this.innerApiCalls.connect(null, options);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ describe('v1beta1.EchoClient', () => {
const response = await promise;
assert.deepStrictEqual(response, expectedResponse);
assert((client.innerApiCalls.chat as SinonStub)
.getCall(0).calledWithExactly(undefined));
.getCall(0).calledWith(null));
assert.deepStrictEqual(((stream as unknown as PassThrough)
._transform as SinonStub).getCall(0).args[0], request);
});
Expand All @@ -547,7 +547,7 @@ describe('v1beta1.EchoClient', () => {
});
await assert.rejects(promise, expectedError);
assert((client.innerApiCalls.chat as SinonStub)
.getCall(0).calledWithExactly(undefined));
.getCall(0).calledWith(null));
assert.deepStrictEqual(((stream as unknown as PassThrough)
._transform as SinonStub).getCall(0).args[0], request);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ describe('v1beta1.MessagingClient', () => {
const response = await promise;
assert.deepStrictEqual(response, expectedResponse);
assert((client.innerApiCalls.connect as SinonStub)
.getCall(0).calledWithExactly(undefined));
.getCall(0).calledWith(null));
assert.deepStrictEqual(((stream as unknown as PassThrough)
._transform as SinonStub).getCall(0).args[0], request);
});
Expand All @@ -1129,7 +1129,7 @@ describe('v1beta1.MessagingClient', () => {
});
await assert.rejects(promise, expectedError);
assert((client.innerApiCalls.connect as SinonStub)
.getCall(0).calledWithExactly(undefined));
.getCall(0).calledWith(null));
assert.deepStrictEqual(((stream as unknown as PassThrough)
._transform as SinonStub).getCall(0).args[0], request);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ export class EchoClient {
options?: CallOptions):
gax.CancellableStream {
this.initialize();
return this.innerApiCalls.chat(options);
return this.innerApiCalls.chat(null, options);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions baselines/showcase-legacy/test/gapic_echo_v1beta1.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ describe('v1beta1.EchoClient', () => {
const response = await promise;
assert.deepStrictEqual(response, expectedResponse);
assert((client.innerApiCalls.chat as SinonStub)
.getCall(0).calledWithExactly(undefined));
.getCall(0).calledWith(null));
assert.deepStrictEqual(((stream as unknown as PassThrough)
._transform as SinonStub).getCall(0).args[0], request);
});
Expand All @@ -540,7 +540,7 @@ describe('v1beta1.EchoClient', () => {
});
await assert.rejects(promise, expectedError);
assert((client.innerApiCalls.chat as SinonStub)
.getCall(0).calledWithExactly(undefined));
.getCall(0).calledWith(null));
assert.deepStrictEqual(((stream as unknown as PassThrough)
._transform as SinonStub).getCall(0).args[0], request);
});
Expand Down
2 changes: 1 addition & 1 deletion baselines/showcase/src/v1beta1/echo_client.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ export class EchoClient {
options?: CallOptions):
gax.CancellableStream {
this.initialize();
return this.innerApiCalls.chat(options);
return this.innerApiCalls.chat(null, options);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ export class MessagingClient {
options?: CallOptions):
gax.CancellableStream {
this.initialize();
return this.innerApiCalls.connect(options);
return this.innerApiCalls.connect(null, options);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions baselines/showcase/test/gapic_echo_v1beta1.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ describe('v1beta1.EchoClient', () => {
const response = await promise;
assert.deepStrictEqual(response, expectedResponse);
assert((client.innerApiCalls.chat as SinonStub)
.getCall(0).calledWithExactly(undefined));
.getCall(0).calledWith(null));
assert.deepStrictEqual(((stream as unknown as PassThrough)
._transform as SinonStub).getCall(0).args[0], request);
});
Expand All @@ -547,7 +547,7 @@ describe('v1beta1.EchoClient', () => {
});
await assert.rejects(promise, expectedError);
assert((client.innerApiCalls.chat as SinonStub)
.getCall(0).calledWithExactly(undefined));
.getCall(0).calledWith(null));
assert.deepStrictEqual(((stream as unknown as PassThrough)
._transform as SinonStub).getCall(0).args[0], request);
});
Expand Down
4 changes: 2 additions & 2 deletions baselines/showcase/test/gapic_messaging_v1beta1.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ describe('v1beta1.MessagingClient', () => {
const response = await promise;
assert.deepStrictEqual(response, expectedResponse);
assert((client.innerApiCalls.connect as SinonStub)
.getCall(0).calledWithExactly(undefined));
.getCall(0).calledWith(null));
assert.deepStrictEqual(((stream as unknown as PassThrough)
._transform as SinonStub).getCall(0).args[0], request);
});
Expand All @@ -1129,7 +1129,7 @@ describe('v1beta1.MessagingClient', () => {
});
await assert.rejects(promise, expectedError);
assert((client.innerApiCalls.connect as SinonStub)
.getCall(0).calledWithExactly(undefined));
.getCall(0).calledWith(null));
assert.deepStrictEqual(((stream as unknown as PassThrough)
._transform as SinonStub).getCall(0).args[0], request);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ export class {{ service.name }}Client {
{%- if method.options and method.options.deprecated %}
this.warn('DEP${{service.name}}-${{method.name}}','{{method.name}} is deprecated and may be removed in a future version.', 'DeprecationWarning');
{%- endif %}
return this.innerApiCalls.{{ method.name.toCamelCase() }}(options);
return this.innerApiCalls.{{ method.name.toCamelCase() }}(null, options);
}
{%- elif method.serverStreaming %}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ describe('{{ api.naming.version }}.{{ service.name }}Client', () => {
{%- endif %}
assert.deepStrictEqual(response, expectedResponse);
assert((client.innerApiCalls.{{ method.name.toCamelCase() }} as SinonStub)
.getCall(0).calledWithExactly(undefined));
.getCall(0).calledWith(null));
assert.deepStrictEqual(((stream as unknown as PassThrough)
._transform as SinonStub).getCall(0).args[0], request);
});
Expand Down Expand Up @@ -578,7 +578,7 @@ describe('{{ api.naming.version }}.{{ service.name }}Client', () => {
assert(stub.calledOnce);
{%- endif %}
assert((client.innerApiCalls.{{ method.name.toCamelCase() }} as SinonStub)
.getCall(0).calledWithExactly(undefined));
.getCall(0).calledWith(null));
assert.deepStrictEqual(((stream as unknown as PassThrough)
._transform as SinonStub).getCall(0).args[0], request);
});
Expand Down

0 comments on commit 1149cb1

Please sign in to comment.