diff --git a/samples/snippets/src/main/java/com/example/bigquerydatatransfer/CreateScheduledQuery.java b/samples/snippets/src/main/java/com/example/bigquerydatatransfer/CreateScheduledQuery.java index b1bce193..ad3b051a 100644 --- a/samples/snippets/src/main/java/com/example/bigquerydatatransfer/CreateScheduledQuery.java +++ b/samples/snippets/src/main/java/com/example/bigquerydatatransfer/CreateScheduledQuery.java @@ -24,7 +24,6 @@ import com.google.cloud.bigquery.datatransfer.v1.TransferConfig; import com.google.protobuf.Struct; import com.google.protobuf.Value; - import java.io.IOException; import java.util.HashMap; import java.util.Map; @@ -34,10 +33,11 @@ public class CreateScheduledQuery { public static void runCreateScheduledQuery() { // TODO(developer): Replace these variables before running the sample. - String projectId = "MY_PROJECT_ID"; - String datasetId = "MY_DATASET_ID"; - String query = - "SELECT CURRENT_TIMESTAMP() as current_time, @run_time as intended_run_time, @run_date as intended_run_date, 17 as some_integer"; + final String projectId = "MY_PROJECT_ID"; + final String datasetId = "MY_DATASET_ID"; + final String query = + "SELECT CURRENT_TIMESTAMP() as current_time, @run_time as intended_run_time, " + + "@run_date as intended_run_date, 17 as some_integer"; Map params = new HashMap<>(); params.put("query", Value.newBuilder().setStringValue(query).build()); params.put( diff --git a/samples/snippets/src/main/java/com/example/bigquerydatatransfer/DeleteScheduledQuery.java b/samples/snippets/src/main/java/com/example/bigquerydatatransfer/DeleteScheduledQuery.java index 7c1d0282..0fbb3577 100644 --- a/samples/snippets/src/main/java/com/example/bigquerydatatransfer/DeleteScheduledQuery.java +++ b/samples/snippets/src/main/java/com/example/bigquerydatatransfer/DeleteScheduledQuery.java @@ -20,7 +20,6 @@ import com.google.api.gax.rpc.ApiException; import com.google.cloud.bigquery.datatransfer.v1.DataTransferServiceClient; import com.google.cloud.bigquery.datatransfer.v1.DeleteTransferConfigRequest; - import java.io.IOException; // Sample to delete a scheduled query diff --git a/samples/snippets/src/main/java/com/example/bigquerydatatransfer/QuickstartSample.java b/samples/snippets/src/main/java/com/example/bigquerydatatransfer/QuickstartSample.java index 943b978e..cae676a2 100644 --- a/samples/snippets/src/main/java/com/example/bigquerydatatransfer/QuickstartSample.java +++ b/samples/snippets/src/main/java/com/example/bigquerydatatransfer/QuickstartSample.java @@ -25,9 +25,7 @@ import com.google.cloud.bigquery.datatransfer.v1.ListDataSourcesRequest; public class QuickstartSample { - /** - * List available data sources for the BigQuery Data Transfer service. - */ + /** List available data sources for the BigQuery Data Transfer service. */ public static void main(String... args) throws Exception { // Sets your Google Cloud Platform project ID. // String projectId = "YOUR_PROJECT_ID"; @@ -40,9 +38,7 @@ public static void main(String... args) throws Exception { // Request the list of available data sources. String parent = String.format("projects/%s", projectId); ListDataSourcesRequest request = - ListDataSourcesRequest.newBuilder() - .setParent(parent) - .build(); + ListDataSourcesRequest.newBuilder().setParent(parent).build(); ListDataSourcesPagedResponse response = client.listDataSources(request); // Print the results. diff --git a/samples/snippets/src/test/java/com/example/bigquerydatatransfer/CreateScheduledQueryIT.java b/samples/snippets/src/test/java/com/example/bigquerydatatransfer/CreateScheduledQueryIT.java index 3cacdc4b..3f585c37 100644 --- a/samples/snippets/src/test/java/com/example/bigquerydatatransfer/CreateScheduledQueryIT.java +++ b/samples/snippets/src/test/java/com/example/bigquerydatatransfer/CreateScheduledQueryIT.java @@ -16,6 +16,9 @@ package com.example.bigquerydatatransfer; +import static com.google.common.truth.Truth.assertThat; +import static junit.framework.TestCase.assertNotNull; + import com.google.cloud.bigquery.BigQuery; import com.google.cloud.bigquery.BigQueryOptions; import com.google.cloud.bigquery.DatasetInfo; @@ -23,19 +26,15 @@ import com.google.cloud.bigquery.datatransfer.v1.TransferState; import com.google.protobuf.Struct; import com.google.protobuf.Value; -import org.junit.After; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.util.HashMap; import java.util.Map; import java.util.UUID; - -import static com.google.common.truth.Truth.assertThat; -import static junit.framework.TestCase.assertNotNull; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; public class CreateScheduledQueryIT { @@ -85,7 +84,8 @@ public void tearDown() { @Test public void testCreateScheduledQuery() { String query = - "SELECT CURRENT_TIMESTAMP() as current_time, @run_time as intended_run_time, @run_date as intended_run_date, 17 as some_integer"; + "SELECT CURRENT_TIMESTAMP() as current_time, @run_time as intended_run_time, " + + "@run_date as intended_run_date, 17 as some_integer"; String destinationTableName = "MY_DESTINATION_TABLE_" + UUID.randomUUID().toString().substring(0, 8) + "_{run_date}"; Map params = new HashMap<>(); diff --git a/samples/snippets/src/test/java/com/example/bigquerydatatransfer/DeleteScheduledQueryIT.java b/samples/snippets/src/test/java/com/example/bigquerydatatransfer/DeleteScheduledQueryIT.java index b22282ed..b36082fc 100644 --- a/samples/snippets/src/test/java/com/example/bigquerydatatransfer/DeleteScheduledQueryIT.java +++ b/samples/snippets/src/test/java/com/example/bigquerydatatransfer/DeleteScheduledQueryIT.java @@ -16,25 +16,24 @@ package com.example.bigquerydatatransfer; +import static com.google.common.truth.Truth.assertThat; +import static junit.framework.TestCase.assertNotNull; + import com.google.cloud.bigquery.BigQuery; import com.google.cloud.bigquery.BigQueryOptions; import com.google.cloud.bigquery.DatasetInfo; import com.google.cloud.bigquery.datatransfer.v1.TransferConfig; import com.google.protobuf.Struct; import com.google.protobuf.Value; -import org.junit.After; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - import java.io.ByteArrayOutputStream; import java.io.PrintStream; import java.util.HashMap; import java.util.Map; import java.util.UUID; - -import static com.google.common.truth.Truth.assertThat; -import static junit.framework.TestCase.assertNotNull; +import org.junit.After; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; public class DeleteScheduledQueryIT { @@ -74,7 +73,8 @@ public void setUp() { // create a scheduled query String query = - "SELECT CURRENT_TIMESTAMP() as current_time, @run_time as intended_run_time, @run_date as intended_run_date, 17 as some_integer"; + "SELECT CURRENT_TIMESTAMP() as current_time, @run_time as intended_run_time, " + + "@run_date as intended_run_date, 17 as some_integer"; String destinationTableName = "MY_DESTINATION_TABLE_" + UUID.randomUUID().toString().substring(0, 8) + "_{run_date}"; Map params = new HashMap<>();