From 437b29b1bc3fbca40221bc5d6678ea98ede04eb7 Mon Sep 17 00:00:00 2001 From: yoshi-automation Date: Mon, 15 Mar 2021 02:17:37 -0700 Subject: [PATCH] chore: update java microgenerator to 1.0.2 Adds request initialization to sample code Committer: @miraleung PiperOrigin-RevId: 362856902 Source-Author: Google APIs Source-Date: Sun Mar 14 20:47:20 2021 -0700 Source-Repo: googleapis/googleapis Source-Sha: 1305ca41d554eb0725237561e34129373bb8cbc1 Source-Link: https://github.com/googleapis/googleapis/commit/1305ca41d554eb0725237561e34129373bb8cbc1 --- .../storage/v1/MockBigQueryReadImpl.java | 12 +++++----- .../v1alpha2/MockBigQueryWriteImpl.java | 22 +++++++++---------- .../v1beta1/MockBigQueryStorageImpl.java | 20 ++++++++--------- .../storage/v1beta2/MockBigQueryReadImpl.java | 12 +++++----- .../v1beta2/MockBigQueryWriteImpl.java | 22 +++++++++---------- synth.metadata | 18 +++++++-------- 6 files changed, 53 insertions(+), 53 deletions(-) diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/MockBigQueryReadImpl.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/MockBigQueryReadImpl.java index dcc6f92747..e39e36a874 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/MockBigQueryReadImpl.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1/MockBigQueryReadImpl.java @@ -61,7 +61,7 @@ public void reset() { @Override public void createReadSession( CreateReadSessionRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof ReadSession) { requests.add(request); responseObserver.onNext(((ReadSession) response)); @@ -73,7 +73,7 @@ public void createReadSession( new IllegalArgumentException( String.format( "Unrecognized response type %s for method CreateReadSession, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), ReadSession.class.getName(), Exception.class.getName()))); } @@ -81,7 +81,7 @@ public void createReadSession( @Override public void readRows(ReadRowsRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof ReadRowsResponse) { requests.add(request); responseObserver.onNext(((ReadRowsResponse) response)); @@ -93,7 +93,7 @@ public void readRows(ReadRowsRequest request, StreamObserver r new IllegalArgumentException( String.format( "Unrecognized response type %s for method ReadRows, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), ReadRowsResponse.class.getName(), Exception.class.getName()))); } @@ -102,7 +102,7 @@ public void readRows(ReadRowsRequest request, StreamObserver r @Override public void splitReadStream( SplitReadStreamRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof SplitReadStreamResponse) { requests.add(request); responseObserver.onNext(((SplitReadStreamResponse) response)); @@ -114,7 +114,7 @@ public void splitReadStream( new IllegalArgumentException( String.format( "Unrecognized response type %s for method SplitReadStream, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), SplitReadStreamResponse.class.getName(), Exception.class.getName()))); } diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1alpha2/MockBigQueryWriteImpl.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1alpha2/MockBigQueryWriteImpl.java index 839586d3f7..4db1302718 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1alpha2/MockBigQueryWriteImpl.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1alpha2/MockBigQueryWriteImpl.java @@ -62,7 +62,7 @@ public void reset() { public void createWriteStream( Storage.CreateWriteStreamRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Stream.WriteStream) { requests.add(request); responseObserver.onNext(((Stream.WriteStream) response)); @@ -74,7 +74,7 @@ public void createWriteStream( new IllegalArgumentException( String.format( "Unrecognized response type %s for method CreateWriteStream, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Stream.WriteStream.class.getName(), Exception.class.getName()))); } @@ -98,7 +98,7 @@ public void onNext(Storage.AppendRowsRequest value) { new IllegalArgumentException( String.format( "Unrecognized response type %s for method AppendRows, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Storage.AppendRowsResponse.class.getName(), Exception.class.getName()))); } @@ -120,7 +120,7 @@ public void onCompleted() { @Override public void getWriteStream( Storage.GetWriteStreamRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Stream.WriteStream) { requests.add(request); responseObserver.onNext(((Stream.WriteStream) response)); @@ -132,7 +132,7 @@ public void getWriteStream( new IllegalArgumentException( String.format( "Unrecognized response type %s for method GetWriteStream, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Stream.WriteStream.class.getName(), Exception.class.getName()))); } @@ -142,7 +142,7 @@ public void getWriteStream( public void finalizeWriteStream( Storage.FinalizeWriteStreamRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Storage.FinalizeWriteStreamResponse) { requests.add(request); responseObserver.onNext(((Storage.FinalizeWriteStreamResponse) response)); @@ -154,7 +154,7 @@ public void finalizeWriteStream( new IllegalArgumentException( String.format( "Unrecognized response type %s for method FinalizeWriteStream, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Storage.FinalizeWriteStreamResponse.class.getName(), Exception.class.getName()))); } @@ -164,7 +164,7 @@ public void finalizeWriteStream( public void batchCommitWriteStreams( Storage.BatchCommitWriteStreamsRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Storage.BatchCommitWriteStreamsResponse) { requests.add(request); responseObserver.onNext(((Storage.BatchCommitWriteStreamsResponse) response)); @@ -176,7 +176,7 @@ public void batchCommitWriteStreams( new IllegalArgumentException( String.format( "Unrecognized response type %s for method BatchCommitWriteStreams, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Storage.BatchCommitWriteStreamsResponse.class.getName(), Exception.class.getName()))); } @@ -186,7 +186,7 @@ public void batchCommitWriteStreams( public void flushRows( Storage.FlushRowsRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Storage.FlushRowsResponse) { requests.add(request); responseObserver.onNext(((Storage.FlushRowsResponse) response)); @@ -198,7 +198,7 @@ public void flushRows( new IllegalArgumentException( String.format( "Unrecognized response type %s for method FlushRows, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Storage.FlushRowsResponse.class.getName(), Exception.class.getName()))); } diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta1/MockBigQueryStorageImpl.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta1/MockBigQueryStorageImpl.java index ded3d64f31..d588dbc818 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta1/MockBigQueryStorageImpl.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta1/MockBigQueryStorageImpl.java @@ -63,7 +63,7 @@ public void reset() { public void createReadSession( Storage.CreateReadSessionRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Storage.ReadSession) { requests.add(request); responseObserver.onNext(((Storage.ReadSession) response)); @@ -75,7 +75,7 @@ public void createReadSession( new IllegalArgumentException( String.format( "Unrecognized response type %s for method CreateReadSession, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Storage.ReadSession.class.getName(), Exception.class.getName()))); } @@ -84,7 +84,7 @@ public void createReadSession( @Override public void readRows( Storage.ReadRowsRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Storage.ReadRowsResponse) { requests.add(request); responseObserver.onNext(((Storage.ReadRowsResponse) response)); @@ -96,7 +96,7 @@ public void readRows( new IllegalArgumentException( String.format( "Unrecognized response type %s for method ReadRows, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Storage.ReadRowsResponse.class.getName(), Exception.class.getName()))); } @@ -106,7 +106,7 @@ public void readRows( public void batchCreateReadSessionStreams( Storage.BatchCreateReadSessionStreamsRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Storage.BatchCreateReadSessionStreamsResponse) { requests.add(request); responseObserver.onNext(((Storage.BatchCreateReadSessionStreamsResponse) response)); @@ -118,7 +118,7 @@ public void batchCreateReadSessionStreams( new IllegalArgumentException( String.format( "Unrecognized response type %s for method BatchCreateReadSessionStreams, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Storage.BatchCreateReadSessionStreamsResponse.class.getName(), Exception.class.getName()))); } @@ -127,7 +127,7 @@ public void batchCreateReadSessionStreams( @Override public void finalizeStream( Storage.FinalizeStreamRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Empty) { requests.add(request); responseObserver.onNext(((Empty) response)); @@ -139,7 +139,7 @@ public void finalizeStream( new IllegalArgumentException( String.format( "Unrecognized response type %s for method FinalizeStream, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Empty.class.getName(), Exception.class.getName()))); } @@ -149,7 +149,7 @@ public void finalizeStream( public void splitReadStream( Storage.SplitReadStreamRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Storage.SplitReadStreamResponse) { requests.add(request); responseObserver.onNext(((Storage.SplitReadStreamResponse) response)); @@ -161,7 +161,7 @@ public void splitReadStream( new IllegalArgumentException( String.format( "Unrecognized response type %s for method SplitReadStream, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Storage.SplitReadStreamResponse.class.getName(), Exception.class.getName()))); } diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/MockBigQueryReadImpl.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/MockBigQueryReadImpl.java index 89c4376a73..cbafa925b7 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/MockBigQueryReadImpl.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/MockBigQueryReadImpl.java @@ -61,7 +61,7 @@ public void reset() { @Override public void createReadSession( CreateReadSessionRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof ReadSession) { requests.add(request); responseObserver.onNext(((ReadSession) response)); @@ -73,7 +73,7 @@ public void createReadSession( new IllegalArgumentException( String.format( "Unrecognized response type %s for method CreateReadSession, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), ReadSession.class.getName(), Exception.class.getName()))); } @@ -81,7 +81,7 @@ public void createReadSession( @Override public void readRows(ReadRowsRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof ReadRowsResponse) { requests.add(request); responseObserver.onNext(((ReadRowsResponse) response)); @@ -93,7 +93,7 @@ public void readRows(ReadRowsRequest request, StreamObserver r new IllegalArgumentException( String.format( "Unrecognized response type %s for method ReadRows, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), ReadRowsResponse.class.getName(), Exception.class.getName()))); } @@ -102,7 +102,7 @@ public void readRows(ReadRowsRequest request, StreamObserver r @Override public void splitReadStream( SplitReadStreamRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof SplitReadStreamResponse) { requests.add(request); responseObserver.onNext(((SplitReadStreamResponse) response)); @@ -114,7 +114,7 @@ public void splitReadStream( new IllegalArgumentException( String.format( "Unrecognized response type %s for method SplitReadStream, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), SplitReadStreamResponse.class.getName(), Exception.class.getName()))); } diff --git a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/MockBigQueryWriteImpl.java b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/MockBigQueryWriteImpl.java index ef95cae5dc..63588f0509 100644 --- a/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/MockBigQueryWriteImpl.java +++ b/google-cloud-bigquerystorage/src/test/java/com/google/cloud/bigquery/storage/v1beta2/MockBigQueryWriteImpl.java @@ -61,7 +61,7 @@ public void reset() { @Override public void createWriteStream( CreateWriteStreamRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof WriteStream) { requests.add(request); responseObserver.onNext(((WriteStream) response)); @@ -73,7 +73,7 @@ public void createWriteStream( new IllegalArgumentException( String.format( "Unrecognized response type %s for method CreateWriteStream, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), WriteStream.class.getName(), Exception.class.getName()))); } @@ -97,7 +97,7 @@ public void onNext(AppendRowsRequest value) { new IllegalArgumentException( String.format( "Unrecognized response type %s for method AppendRows, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), AppendRowsResponse.class.getName(), Exception.class.getName()))); } @@ -119,7 +119,7 @@ public void onCompleted() { @Override public void getWriteStream( GetWriteStreamRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof WriteStream) { requests.add(request); responseObserver.onNext(((WriteStream) response)); @@ -131,7 +131,7 @@ public void getWriteStream( new IllegalArgumentException( String.format( "Unrecognized response type %s for method GetWriteStream, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), WriteStream.class.getName(), Exception.class.getName()))); } @@ -141,7 +141,7 @@ public void getWriteStream( public void finalizeWriteStream( FinalizeWriteStreamRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof FinalizeWriteStreamResponse) { requests.add(request); responseObserver.onNext(((FinalizeWriteStreamResponse) response)); @@ -153,7 +153,7 @@ public void finalizeWriteStream( new IllegalArgumentException( String.format( "Unrecognized response type %s for method FinalizeWriteStream, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), FinalizeWriteStreamResponse.class.getName(), Exception.class.getName()))); } @@ -163,7 +163,7 @@ public void finalizeWriteStream( public void batchCommitWriteStreams( BatchCommitWriteStreamsRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof BatchCommitWriteStreamsResponse) { requests.add(request); responseObserver.onNext(((BatchCommitWriteStreamsResponse) response)); @@ -175,7 +175,7 @@ public void batchCommitWriteStreams( new IllegalArgumentException( String.format( "Unrecognized response type %s for method BatchCommitWriteStreams, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), BatchCommitWriteStreamsResponse.class.getName(), Exception.class.getName()))); } @@ -184,7 +184,7 @@ public void batchCommitWriteStreams( @Override public void flushRows( FlushRowsRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof FlushRowsResponse) { requests.add(request); responseObserver.onNext(((FlushRowsResponse) response)); @@ -196,7 +196,7 @@ public void flushRows( new IllegalArgumentException( String.format( "Unrecognized response type %s for method FlushRows, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), FlushRowsResponse.class.getName(), Exception.class.getName()))); } diff --git a/synth.metadata b/synth.metadata index 36935d0b5f..c2df6fdd85 100644 --- a/synth.metadata +++ b/synth.metadata @@ -11,39 +11,39 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigquerystorage.git", - "sha": "c6779da61368c38ec6889bdfcb09a147c343a8f7" + "sha": "4a09405fc1064e4a0f9c7bc9a1c0e150a33caaa8" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "0e915217fb5261c1e57bfaf0e16ee5c7feaaba89", - "internalRef": "361377784" + "sha": "1305ca41d554eb0725237561e34129373bb8cbc1", + "internalRef": "362856902" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "0e915217fb5261c1e57bfaf0e16ee5c7feaaba89", - "internalRef": "361377784" + "sha": "1305ca41d554eb0725237561e34129373bb8cbc1", + "internalRef": "362856902" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "0e915217fb5261c1e57bfaf0e16ee5c7feaaba89", - "internalRef": "361377784" + "sha": "1305ca41d554eb0725237561e34129373bb8cbc1", + "internalRef": "362856902" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "0e915217fb5261c1e57bfaf0e16ee5c7feaaba89", - "internalRef": "361377784" + "sha": "1305ca41d554eb0725237561e34129373bb8cbc1", + "internalRef": "362856902" } }, {