Skip to content

Commit a0ce45a

Browse files
committed
ci: pass linter
Signed-off-by: Grant Timmerman <timmerman+devrel@google.com>
1 parent 9c0360f commit a0ce45a

File tree

2 files changed

+32
-13
lines changed

2 files changed

+32
-13
lines changed

workflows/cloud-client/src/main/java/com/example/workflows/WorkflowsQuickstart.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ public static String workflowsQuickstart(String projectId, String location, Stri
7777
* Demonstrates using the Workflows API.
7878
*/
7979
public static void main(String... args) {
80-
if (GOOGLE_CLOUD_PROJECT.isEmpty()) System.out.println("GOOGLE_CLOUD_PROJECT is empty");
80+
if (GOOGLE_CLOUD_PROJECT.isEmpty()) {
81+
System.out.println("GOOGLE_CLOUD_PROJECT is empty");
82+
}
8183
if (LOCATION == null || LOCATION.isEmpty()) {
8284
LOCATION = "us-central1";
8385
}

workflows/cloud-client/src/test/java/com/example/workflows/WorkflowsQuickstartTest.java

+29-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,32 @@
1+
/*
2+
* Copyright 2021 Google Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.example.workflows;
218

3-
import com.google.api.gax.longrunning.OperationFuture;
4-
import com.google.cloud.workflows.v1.OperationMetadata;
19+
import static com.example.workflows.WorkflowsQuickstart.workflowsQuickstart;
20+
import static org.junit.Assert.assertNotEquals;
21+
import static org.junit.Assert.assertNotNull;
22+
523
import com.google.cloud.workflows.v1.Workflow;
24+
import com.google.cloud.workflows.v1.WorkflowName;
625
import com.google.cloud.workflows.v1.WorkflowsClient;
26+
import java.io.IOException;
727
import org.junit.BeforeClass;
828
import org.junit.Test;
929

10-
import com.google.cloud.workflows.v1.WorkflowName;
11-
12-
import java.io.IOException;
13-
14-
import static com.example.workflows.WorkflowsQuickstart.workflowsQuickstart;
15-
import static org.junit.Assert.*;
16-
1730
public class WorkflowsQuickstartTest {
1831

1932
private static String projectId;
@@ -29,7 +42,8 @@ public static void beforeClass() {
2942
final String ENV_GOOGLE_CLOUD_PROJECT = "GOOGLE_CLOUD_PROJECT";
3043
projectId = System.getenv(ENV_GOOGLE_CLOUD_PROJECT);
3144
assertNotNull(
32-
String.format("Environment variable '%s' is required to perform these tests.", ENV_GOOGLE_CLOUD_PROJECT),
45+
String.format("Environment variable '%s' is required to perform these tests.",
46+
ENV_GOOGLE_CLOUD_PROJECT),
3347
projectId);
3448
}
3549

@@ -48,7 +62,8 @@ public void testQuickstart() throws IOException, InterruptedException {
4862
assertNotEquals("Result should not be empty", res, "");
4963
}
5064

51-
private boolean deployWorkflow(String projectId, String location, String workflowId) throws IOException, InterruptedException {
65+
private boolean deployWorkflow(String projectId, String location, String workflowId)
66+
throws IOException, InterruptedException {
5267
// Create a new workflow if it doesn't exist
5368
if (!workflowExists(projectId, location, workflowId)) {
5469
System.out.println("START DEPLOY");
@@ -73,7 +88,8 @@ private boolean deployWorkflow(String projectId, String location, String workflo
7388
.setWorkflow(workflowId)
7489
.build());
7590
Thread.sleep(2_000);
76-
} while (deployedWorkflow == null || deployedWorkflow.getState().equals(Workflow.State.ACTIVE));
91+
} while (deployedWorkflow == null
92+
|| deployedWorkflow.getState().equals(Workflow.State.ACTIVE));
7793

7894
// Return true if the workflow is now active
7995
return deployedWorkflow.getState() != Workflow.State.ACTIVE;
@@ -83,6 +99,7 @@ private boolean deployWorkflow(String projectId, String location, String workflo
8399

84100
/**
85101
* Returns true if the workflow exists.
102+
*
86103
* @return {boolean} True if the workflow exists already.
87104
*/
88105
private boolean workflowExists(String projectId, String location, String workflow) {

0 commit comments

Comments
 (0)