diff --git a/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java index 5e73912eb33f..7cef1c2586bf 100644 --- a/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java +++ b/java-workflows/google-cloud-workflows/src/main/java/com/google/cloud/workflows/v1beta/WorkflowsClient.java @@ -281,6 +281,14 @@ public final ListWorkflowsPagedResponse listWorkflows(ListWorkflowsRequest reque * *
{@code * try (WorkflowsClient workflowsClient = WorkflowsClient.create()) { + * ListWorkflowsRequest request = + * ListWorkflowsRequest.newBuilder() + * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .setOrderBy("orderBy-1207110587") + * .build(); * while (true) { * ListWorkflowsResponse response = workflowsClient.listWorkflowsCallable().call(request); * for (Workflow element : response.getResponsesList()) { diff --git a/java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflowsImpl.java b/java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflowsImpl.java index 6a8b27c9e8a7..fc08de504bd8 100644 --- a/java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflowsImpl.java +++ b/java-workflows/google-cloud-workflows/src/test/java/com/google/cloud/workflows/v1beta/MockWorkflowsImpl.java @@ -62,7 +62,7 @@ public void reset() { @Override public void listWorkflows( ListWorkflowsRequest request, StreamObserverresponseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof ListWorkflowsResponse) { requests.add(request); responseObserver.onNext(((ListWorkflowsResponse) response)); @@ -74,7 +74,7 @@ public void listWorkflows( new IllegalArgumentException( String.format( "Unrecognized response type %s for method ListWorkflows, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), ListWorkflowsResponse.class.getName(), Exception.class.getName()))); } @@ -82,7 +82,7 @@ public void listWorkflows( @Override public void getWorkflow(GetWorkflowRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Workflow) { requests.add(request); responseObserver.onNext(((Workflow) response)); @@ -94,7 +94,7 @@ public void getWorkflow(GetWorkflowRequest request, StreamObserver res new IllegalArgumentException( String.format( "Unrecognized response type %s for method GetWorkflow, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Workflow.class.getName(), Exception.class.getName()))); } @@ -103,7 +103,7 @@ public void getWorkflow(GetWorkflowRequest request, StreamObserver res @Override public void createWorkflow( CreateWorkflowRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Operation) { requests.add(request); responseObserver.onNext(((Operation) response)); @@ -115,7 +115,7 @@ public void createWorkflow( new IllegalArgumentException( String.format( "Unrecognized response type %s for method CreateWorkflow, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Operation.class.getName(), Exception.class.getName()))); } @@ -124,7 +124,7 @@ public void createWorkflow( @Override public void deleteWorkflow( DeleteWorkflowRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Operation) { requests.add(request); responseObserver.onNext(((Operation) response)); @@ -136,7 +136,7 @@ public void deleteWorkflow( new IllegalArgumentException( String.format( "Unrecognized response type %s for method DeleteWorkflow, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Operation.class.getName(), Exception.class.getName()))); } @@ -145,7 +145,7 @@ public void deleteWorkflow( @Override public void updateWorkflow( UpdateWorkflowRequest request, StreamObserver responseObserver) { - Object response = responses.remove(); + Object response = responses.poll(); if (response instanceof Operation) { requests.add(request); responseObserver.onNext(((Operation) response)); @@ -157,7 +157,7 @@ public void updateWorkflow( new IllegalArgumentException( String.format( "Unrecognized response type %s for method UpdateWorkflow, expected %s or %s", - response.getClass().getName(), + response == null ? "null" : response.getClass().getName(), Operation.class.getName(), Exception.class.getName()))); } diff --git a/java-workflows/synth.metadata b/java-workflows/synth.metadata index 1ec6161aec2f..dd5631b553da 100644 --- a/java-workflows/synth.metadata +++ b/java-workflows/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-workflows.git", - "sha": "47a3bf4d8f12110af1fe4571e661dc08656644cb" + "sha": "68b345fd4fd74a977281376f6bb6abde1e803db3" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "0e915217fb5261c1e57bfaf0e16ee5c7feaaba89", - "internalRef": "361377784" + "sha": "1305ca41d554eb0725237561e34129373bb8cbc1", + "internalRef": "362856902" } }, {