From 168099b38ae52dcf1040f7d5353a98750dad632e Mon Sep 17 00:00:00 2001 From: Averi Kitsch Date: Fri, 27 Mar 2020 12:00:25 -0700 Subject: [PATCH] samples: update shared config (#2443) * update shared config * Update to 1.0.13 * lint * Fix linting * lint * fix imports Co-authored-by: Les Vogel --- .../example/translate/BatchTranslateText.java | 3 +-- .../BatchTranslateTextWithGlossary.java | 1 - ...atchTranslateTextWithGlossaryAndModel.java | 1 - .../BatchTranslateTextWithModel.java | 3 +-- .../com/example/translate/CreateGlossary.java | 1 - .../com/example/translate/DeleteGlossary.java | 1 - .../com/example/translate/DetectLanguage.java | 1 - .../com/example/translate/GetGlossary.java | 1 - .../translate/GetSupportedLanguages.java | 1 - .../GetSupportedLanguagesForTarget.java | 1 - .../com/example/translate/ListGlossaries.java | 1 - .../example/translate/QuickstartSample.java | 5 +--- .../com/example/translate/TranslateText.java | 1 - .../translate/TranslateTextWithGlossary.java | 1 - .../TranslateTextWithGlossaryAndModel.java | 1 - .../translate/TranslateTextWithModel.java | 1 - .../translate/BatchTranslateTextTests.java | 7 ++---- ...ranslateTextWithGlossaryAndModelTests.java | 24 ++----------------- .../BatchTranslateTextWithGlossaryTests.java | 23 ++---------------- .../BatchTranslateTextWithModelTests.java | 11 ++------- .../translate/CreateGlossaryTests.java | 1 - .../translate/DeleteGlossaryTests.java | 4 +--- .../example/translate/GetGlossaryTests.java | 14 ----------- .../translate/ListGlossariesTests.java | 14 ----------- .../example/translate/QuickstartSampleIT.java | 4 +--- ...ranslateTextWithGlossaryAndModelTests.java | 14 ----------- .../TranslateTextWithGlossaryTests.java | 14 ----------- 27 files changed, 13 insertions(+), 141 deletions(-) diff --git a/translate/snippets/src/main/java/com/example/translate/BatchTranslateText.java b/translate/snippets/src/main/java/com/example/translate/BatchTranslateText.java index 466c3cd7fa0..118cf6bff97 100644 --- a/translate/snippets/src/main/java/com/example/translate/BatchTranslateText.java +++ b/translate/snippets/src/main/java/com/example/translate/BatchTranslateText.java @@ -27,7 +27,6 @@ import com.google.cloud.translate.v3.LocationName; import com.google.cloud.translate.v3.OutputConfig; import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.IOException; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; @@ -54,7 +53,7 @@ public static void batchTranslateText( String targetLanguage, String inputUri, String outputUri) - throws IOException, ExecutionException, InterruptedException, TimeoutException { + throws IOException, ExecutionException, InterruptedException, TimeoutException { // Initialize client that will be used to send requests. This client only needs to be created // once, and can be reused for multiple requests. After completing all of your requests, call diff --git a/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithGlossary.java b/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithGlossary.java index f622c5f6f05..a839d500ac4 100644 --- a/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithGlossary.java +++ b/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithGlossary.java @@ -29,7 +29,6 @@ import com.google.cloud.translate.v3.OutputConfig; import com.google.cloud.translate.v3.TranslateTextGlossaryConfig; import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.IOException; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; diff --git a/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithGlossaryAndModel.java b/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithGlossaryAndModel.java index e1a52b819a4..92615eb1b4c 100644 --- a/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithGlossaryAndModel.java +++ b/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithGlossaryAndModel.java @@ -29,7 +29,6 @@ import com.google.cloud.translate.v3.OutputConfig; import com.google.cloud.translate.v3.TranslateTextGlossaryConfig; import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.IOException; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; diff --git a/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithModel.java b/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithModel.java index dbc70058586..acce714753a 100644 --- a/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithModel.java +++ b/translate/snippets/src/main/java/com/example/translate/BatchTranslateTextWithModel.java @@ -27,7 +27,6 @@ import com.google.cloud.translate.v3.LocationName; import com.google.cloud.translate.v3.OutputConfig; import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.IOException; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; @@ -57,7 +56,7 @@ public static void batchTranslateTextWithModel( String inputUri, String outputUri, String modelId) - throws IOException, ExecutionException, InterruptedException, TimeoutException { + throws IOException, ExecutionException, InterruptedException, TimeoutException { // Initialize client that will be used to send requests. This client only needs to be created // once, and can be reused for multiple requests. After completing all of your requests, call diff --git a/translate/snippets/src/main/java/com/example/translate/CreateGlossary.java b/translate/snippets/src/main/java/com/example/translate/CreateGlossary.java index a99f10def6f..ab9f7de4f0e 100644 --- a/translate/snippets/src/main/java/com/example/translate/CreateGlossary.java +++ b/translate/snippets/src/main/java/com/example/translate/CreateGlossary.java @@ -26,7 +26,6 @@ import com.google.cloud.translate.v3.GlossaryName; import com.google.cloud.translate.v3.LocationName; import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.IOException; import java.util.ArrayList; import java.util.List; diff --git a/translate/snippets/src/main/java/com/example/translate/DeleteGlossary.java b/translate/snippets/src/main/java/com/example/translate/DeleteGlossary.java index 73fe577a303..78266cdb5e1 100644 --- a/translate/snippets/src/main/java/com/example/translate/DeleteGlossary.java +++ b/translate/snippets/src/main/java/com/example/translate/DeleteGlossary.java @@ -23,7 +23,6 @@ import com.google.cloud.translate.v3.DeleteGlossaryResponse; import com.google.cloud.translate.v3.GlossaryName; import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.IOException; import java.util.concurrent.ExecutionException; diff --git a/translate/snippets/src/main/java/com/example/translate/DetectLanguage.java b/translate/snippets/src/main/java/com/example/translate/DetectLanguage.java index 945dad8f07e..a1b4c5fb19f 100644 --- a/translate/snippets/src/main/java/com/example/translate/DetectLanguage.java +++ b/translate/snippets/src/main/java/com/example/translate/DetectLanguage.java @@ -22,7 +22,6 @@ import com.google.cloud.translate.v3.DetectedLanguage; import com.google.cloud.translate.v3.LocationName; import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.IOException; public class DetectLanguage { diff --git a/translate/snippets/src/main/java/com/example/translate/GetGlossary.java b/translate/snippets/src/main/java/com/example/translate/GetGlossary.java index e400f503ae0..c3e8283bd13 100644 --- a/translate/snippets/src/main/java/com/example/translate/GetGlossary.java +++ b/translate/snippets/src/main/java/com/example/translate/GetGlossary.java @@ -21,7 +21,6 @@ import com.google.cloud.translate.v3.Glossary; import com.google.cloud.translate.v3.GlossaryName; import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.IOException; public class GetGlossary { diff --git a/translate/snippets/src/main/java/com/example/translate/GetSupportedLanguages.java b/translate/snippets/src/main/java/com/example/translate/GetSupportedLanguages.java index 32963c406bf..08eb5d46b65 100644 --- a/translate/snippets/src/main/java/com/example/translate/GetSupportedLanguages.java +++ b/translate/snippets/src/main/java/com/example/translate/GetSupportedLanguages.java @@ -22,7 +22,6 @@ import com.google.cloud.translate.v3.SupportedLanguage; import com.google.cloud.translate.v3.SupportedLanguages; import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.IOException; public class GetSupportedLanguages { diff --git a/translate/snippets/src/main/java/com/example/translate/GetSupportedLanguagesForTarget.java b/translate/snippets/src/main/java/com/example/translate/GetSupportedLanguagesForTarget.java index 1001ae7a551..d3de319ad5c 100644 --- a/translate/snippets/src/main/java/com/example/translate/GetSupportedLanguagesForTarget.java +++ b/translate/snippets/src/main/java/com/example/translate/GetSupportedLanguagesForTarget.java @@ -22,7 +22,6 @@ import com.google.cloud.translate.v3.SupportedLanguage; import com.google.cloud.translate.v3.SupportedLanguages; import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.IOException; public class GetSupportedLanguagesForTarget { diff --git a/translate/snippets/src/main/java/com/example/translate/ListGlossaries.java b/translate/snippets/src/main/java/com/example/translate/ListGlossaries.java index 055c2d14058..129d58ec7b7 100644 --- a/translate/snippets/src/main/java/com/example/translate/ListGlossaries.java +++ b/translate/snippets/src/main/java/com/example/translate/ListGlossaries.java @@ -21,7 +21,6 @@ import com.google.cloud.translate.v3.ListGlossariesRequest; import com.google.cloud.translate.v3.LocationName; import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.IOException; public class ListGlossaries { diff --git a/translate/snippets/src/main/java/com/example/translate/QuickstartSample.java b/translate/snippets/src/main/java/com/example/translate/QuickstartSample.java index bf3aad063e1..d946c13aada 100644 --- a/translate/snippets/src/main/java/com/example/translate/QuickstartSample.java +++ b/translate/snippets/src/main/java/com/example/translate/QuickstartSample.java @@ -34,10 +34,7 @@ public static void main(String... args) throws Exception { // Translates some text into Russian Translation translation = translate.translate( - text, - TranslateOption.sourceLanguage("en"), - TranslateOption.targetLanguage("ru")); - + text, TranslateOption.sourceLanguage("en"), TranslateOption.targetLanguage("ru")); System.out.printf("Text: %s%n", text); System.out.printf("Translation: %s%n", translation.getTranslatedText()); diff --git a/translate/snippets/src/main/java/com/example/translate/TranslateText.java b/translate/snippets/src/main/java/com/example/translate/TranslateText.java index 94989428218..a36b54a65b5 100644 --- a/translate/snippets/src/main/java/com/example/translate/TranslateText.java +++ b/translate/snippets/src/main/java/com/example/translate/TranslateText.java @@ -22,7 +22,6 @@ import com.google.cloud.translate.v3.TranslateTextResponse; import com.google.cloud.translate.v3.Translation; import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.IOException; public class TranslateText { diff --git a/translate/snippets/src/main/java/com/example/translate/TranslateTextWithGlossary.java b/translate/snippets/src/main/java/com/example/translate/TranslateTextWithGlossary.java index 07e0c6c7e03..78c35aa66e7 100644 --- a/translate/snippets/src/main/java/com/example/translate/TranslateTextWithGlossary.java +++ b/translate/snippets/src/main/java/com/example/translate/TranslateTextWithGlossary.java @@ -24,7 +24,6 @@ import com.google.cloud.translate.v3.TranslateTextResponse; import com.google.cloud.translate.v3.Translation; import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.IOException; public class TranslateTextWithGlossary { diff --git a/translate/snippets/src/main/java/com/example/translate/TranslateTextWithGlossaryAndModel.java b/translate/snippets/src/main/java/com/example/translate/TranslateTextWithGlossaryAndModel.java index 473d3042eba..a383689deec 100644 --- a/translate/snippets/src/main/java/com/example/translate/TranslateTextWithGlossaryAndModel.java +++ b/translate/snippets/src/main/java/com/example/translate/TranslateTextWithGlossaryAndModel.java @@ -24,7 +24,6 @@ import com.google.cloud.translate.v3.TranslateTextResponse; import com.google.cloud.translate.v3.Translation; import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.IOException; public class TranslateTextWithGlossaryAndModel { diff --git a/translate/snippets/src/main/java/com/example/translate/TranslateTextWithModel.java b/translate/snippets/src/main/java/com/example/translate/TranslateTextWithModel.java index ace54514837..9d81c7979d9 100644 --- a/translate/snippets/src/main/java/com/example/translate/TranslateTextWithModel.java +++ b/translate/snippets/src/main/java/com/example/translate/TranslateTextWithModel.java @@ -22,7 +22,6 @@ import com.google.cloud.translate.v3.TranslateTextResponse; import com.google.cloud.translate.v3.Translation; import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.IOException; public class TranslateTextWithModel { diff --git a/translate/snippets/src/test/java/com/example/translate/BatchTranslateTextTests.java b/translate/snippets/src/test/java/com/example/translate/BatchTranslateTextTests.java index ccd20972474..2b41f00d9ac 100644 --- a/translate/snippets/src/test/java/com/example/translate/BatchTranslateTextTests.java +++ b/translate/snippets/src/test/java/com/example/translate/BatchTranslateTextTests.java @@ -23,14 +23,12 @@ import com.google.cloud.storage.Blob; import com.google.cloud.storage.Storage; import com.google.cloud.storage.StorageOptions; - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; import java.util.UUID; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; - import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; @@ -46,7 +44,7 @@ public class BatchTranslateTextTests { private static final String INPUT_URI = "gs://cloud-samples-data/translation/text.txt"; private static final String PREFIX = "BATCH_TRANSLATION_OUTPUT/"; private static final String OUTPUT_URI = - String.format("gs://%s/%s%s/", PROJECT_ID, PREFIX, UUID.randomUUID()); + String.format("gs://%s/%s%s/", PROJECT_ID, PREFIX, UUID.randomUUID()); private ByteArrayOutputStream bout; private PrintStream out; @@ -105,8 +103,7 @@ public void tearDown() { @Test public void testBatchTranslateText() throws InterruptedException, ExecutionException, IOException, TimeoutException { - BatchTranslateText.batchTranslateText( - PROJECT_ID, "en", "es", INPUT_URI, OUTPUT_URI); + BatchTranslateText.batchTranslateText(PROJECT_ID, "en", "es", INPUT_URI, OUTPUT_URI); String got = bout.toString(); assertThat(got).contains("Total Characters: 13"); } diff --git a/translate/snippets/src/test/java/com/example/translate/BatchTranslateTextWithGlossaryAndModelTests.java b/translate/snippets/src/test/java/com/example/translate/BatchTranslateTextWithGlossaryAndModelTests.java index e8fe25709a2..b88419d9d5f 100644 --- a/translate/snippets/src/test/java/com/example/translate/BatchTranslateTextWithGlossaryAndModelTests.java +++ b/translate/snippets/src/test/java/com/example/translate/BatchTranslateTextWithGlossaryAndModelTests.java @@ -19,23 +19,10 @@ import static com.google.common.truth.Truth.assertThat; import static junit.framework.TestCase.assertNotNull; -import com.google.api.gax.longrunning.OperationFuture; import com.google.api.gax.paging.Page; import com.google.cloud.storage.Blob; import com.google.cloud.storage.Storage; import com.google.cloud.storage.StorageOptions; -import com.google.cloud.translate.v3.CreateGlossaryMetadata; -import com.google.cloud.translate.v3.CreateGlossaryRequest; -import com.google.cloud.translate.v3.DeleteGlossaryMetadata; -import com.google.cloud.translate.v3.DeleteGlossaryRequest; -import com.google.cloud.translate.v3.DeleteGlossaryResponse; -import com.google.cloud.translate.v3.GcsSource; -import com.google.cloud.translate.v3.Glossary; -import com.google.cloud.translate.v3.GlossaryInputConfig; -import com.google.cloud.translate.v3.GlossaryName; -import com.google.cloud.translate.v3.LocationName; -import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; @@ -44,7 +31,6 @@ import java.util.UUID; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; - import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; @@ -66,7 +52,7 @@ public class BatchTranslateTextWithGlossaryAndModelTests { "gs://cloud-samples-data/translation/glossary_ja.csv"; private static final String PREFIX = "BATCH_TRANSLATION_OUTPUT/"; private static final String OUTPUT_URI = - String.format("gs://%s/%s%s/", PROJECT_ID, PREFIX, UUID.randomUUID()); + String.format("gs://%s/%s%s/", PROJECT_ID, PREFIX, UUID.randomUUID()); private ByteArrayOutputStream bout; private PrintStream out; @@ -136,13 +122,7 @@ public void tearDown() throws InterruptedException, ExecutionException, IOExcept public void testBatchTranslateTextWithGlossaryAndModel() throws InterruptedException, ExecutionException, IOException, TimeoutException { BatchTranslateTextWithGlossaryAndModel.batchTranslateTextWithGlossaryAndModel( - PROJECT_ID, - "en", - "ja", - INPUT_URI, - OUTPUT_URI, - GLOSSARY_ID, - MODEL_ID); + PROJECT_ID, "en", "ja", INPUT_URI, OUTPUT_URI, GLOSSARY_ID, MODEL_ID); String got = bout.toString(); assertThat(got).contains("Total Characters: 25"); } diff --git a/translate/snippets/src/test/java/com/example/translate/BatchTranslateTextWithGlossaryTests.java b/translate/snippets/src/test/java/com/example/translate/BatchTranslateTextWithGlossaryTests.java index ebd61202233..92258d8ee89 100644 --- a/translate/snippets/src/test/java/com/example/translate/BatchTranslateTextWithGlossaryTests.java +++ b/translate/snippets/src/test/java/com/example/translate/BatchTranslateTextWithGlossaryTests.java @@ -19,23 +19,10 @@ import static com.google.common.truth.Truth.assertThat; import static junit.framework.TestCase.assertNotNull; -import com.google.api.gax.longrunning.OperationFuture; import com.google.api.gax.paging.Page; import com.google.cloud.storage.Blob; import com.google.cloud.storage.Storage; import com.google.cloud.storage.StorageOptions; -import com.google.cloud.translate.v3.CreateGlossaryMetadata; -import com.google.cloud.translate.v3.CreateGlossaryRequest; -import com.google.cloud.translate.v3.DeleteGlossaryMetadata; -import com.google.cloud.translate.v3.DeleteGlossaryRequest; -import com.google.cloud.translate.v3.DeleteGlossaryResponse; -import com.google.cloud.translate.v3.GcsSource; -import com.google.cloud.translate.v3.Glossary; -import com.google.cloud.translate.v3.GlossaryInputConfig; -import com.google.cloud.translate.v3.GlossaryName; -import com.google.cloud.translate.v3.LocationName; -import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; @@ -44,7 +31,6 @@ import java.util.UUID; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; - import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; @@ -65,7 +51,7 @@ public class BatchTranslateTextWithGlossaryTests { String.format("test_%s", UUID.randomUUID().toString().replace("-", "_").substring(0, 26)); private static final String PREFIX = "BATCH_TRANSLATION_OUTPUT/"; private static final String OUTPUT_URI = - String.format("gs://%s/%s%s/", PROJECT_ID, PREFIX, UUID.randomUUID()); + String.format("gs://%s/%s%s/", PROJECT_ID, PREFIX, UUID.randomUUID()); private ByteArrayOutputStream bout; private PrintStream out; @@ -136,12 +122,7 @@ public void tearDown() throws InterruptedException, ExecutionException, IOExcept public void testBatchTranslateTextWithGlossary() throws InterruptedException, ExecutionException, IOException, TimeoutException { BatchTranslateTextWithGlossary.batchTranslateTextWithGlossary( - PROJECT_ID, - "en", - "ja", - INPUT_URI, - OUTPUT_URI, - GLOSSARY_ID); + PROJECT_ID, "en", "ja", INPUT_URI, OUTPUT_URI, GLOSSARY_ID); String got = bout.toString(); assertThat(got).contains("Total Characters: 9"); } diff --git a/translate/snippets/src/test/java/com/example/translate/BatchTranslateTextWithModelTests.java b/translate/snippets/src/test/java/com/example/translate/BatchTranslateTextWithModelTests.java index f81a0faa307..db7ef195c18 100644 --- a/translate/snippets/src/test/java/com/example/translate/BatchTranslateTextWithModelTests.java +++ b/translate/snippets/src/test/java/com/example/translate/BatchTranslateTextWithModelTests.java @@ -20,7 +20,6 @@ import static junit.framework.TestCase.assertNotNull; import com.google.api.gax.paging.Page; - import com.google.cloud.storage.Blob; import com.google.cloud.storage.Storage; import com.google.cloud.storage.StorageOptions; @@ -30,7 +29,6 @@ import java.util.UUID; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeoutException; - import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; @@ -48,7 +46,7 @@ public class BatchTranslateTextWithModelTests { private static final String MODEL_ID = "TRL2188848820815848149"; private static final String PREFIX = "BATCH_TRANSLATION_OUTPUT/"; private static final String OUTPUT_URI = - String.format("gs://%s/%s%s/", PROJECT_ID, PREFIX, UUID.randomUUID()); + String.format("gs://%s/%s%s/", PROJECT_ID, PREFIX, UUID.randomUUID()); private ByteArrayOutputStream bout; private PrintStream out; @@ -108,12 +106,7 @@ public void tearDown() { public void testBatchTranslateTextWithModel() throws InterruptedException, ExecutionException, IOException, TimeoutException { BatchTranslateTextWithModel.batchTranslateTextWithModel( - PROJECT_ID, - "en", - "ja", - INPUT_URI, - OUTPUT_URI, - MODEL_ID); + PROJECT_ID, "en", "ja", INPUT_URI, OUTPUT_URI, MODEL_ID); String got = bout.toString(); assertThat(got).contains("Total Characters: 15"); } diff --git a/translate/snippets/src/test/java/com/example/translate/CreateGlossaryTests.java b/translate/snippets/src/test/java/com/example/translate/CreateGlossaryTests.java index b3ccb01395e..258dd37813f 100644 --- a/translate/snippets/src/test/java/com/example/translate/CreateGlossaryTests.java +++ b/translate/snippets/src/test/java/com/example/translate/CreateGlossaryTests.java @@ -26,7 +26,6 @@ import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; - import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; diff --git a/translate/snippets/src/test/java/com/example/translate/DeleteGlossaryTests.java b/translate/snippets/src/test/java/com/example/translate/DeleteGlossaryTests.java index 8fe5fd660c4..800a32361c0 100644 --- a/translate/snippets/src/test/java/com/example/translate/DeleteGlossaryTests.java +++ b/translate/snippets/src/test/java/com/example/translate/DeleteGlossaryTests.java @@ -26,7 +26,6 @@ import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; - import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; @@ -81,8 +80,7 @@ public void tearDown() { } @Test - public void testDeleteGlossary() - throws InterruptedException, ExecutionException, IOException { + public void testDeleteGlossary() throws InterruptedException, ExecutionException, IOException { DeleteGlossary.deleteGlossary(PROJECT_ID, GLOSSARY_ID); String got = bout.toString(); assertThat(got).contains("us-central1"); diff --git a/translate/snippets/src/test/java/com/example/translate/GetGlossaryTests.java b/translate/snippets/src/test/java/com/example/translate/GetGlossaryTests.java index d082c4fddb0..b8ce2cdb99a 100644 --- a/translate/snippets/src/test/java/com/example/translate/GetGlossaryTests.java +++ b/translate/snippets/src/test/java/com/example/translate/GetGlossaryTests.java @@ -19,19 +19,6 @@ import static com.google.common.truth.Truth.assertThat; import static junit.framework.TestCase.assertNotNull; -import com.google.api.gax.longrunning.OperationFuture; -import com.google.cloud.translate.v3.CreateGlossaryMetadata; -import com.google.cloud.translate.v3.CreateGlossaryRequest; -import com.google.cloud.translate.v3.DeleteGlossaryMetadata; -import com.google.cloud.translate.v3.DeleteGlossaryRequest; -import com.google.cloud.translate.v3.DeleteGlossaryResponse; -import com.google.cloud.translate.v3.GcsSource; -import com.google.cloud.translate.v3.Glossary; -import com.google.cloud.translate.v3.GlossaryInputConfig; -import com.google.cloud.translate.v3.GlossaryName; -import com.google.cloud.translate.v3.LocationName; -import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; @@ -39,7 +26,6 @@ import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; - import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; diff --git a/translate/snippets/src/test/java/com/example/translate/ListGlossariesTests.java b/translate/snippets/src/test/java/com/example/translate/ListGlossariesTests.java index ee87cfdf67f..55776b32805 100644 --- a/translate/snippets/src/test/java/com/example/translate/ListGlossariesTests.java +++ b/translate/snippets/src/test/java/com/example/translate/ListGlossariesTests.java @@ -19,19 +19,6 @@ import static com.google.common.truth.Truth.assertThat; import static junit.framework.TestCase.assertNotNull; -import com.google.api.gax.longrunning.OperationFuture; -import com.google.cloud.translate.v3.CreateGlossaryMetadata; -import com.google.cloud.translate.v3.CreateGlossaryRequest; -import com.google.cloud.translate.v3.DeleteGlossaryMetadata; -import com.google.cloud.translate.v3.DeleteGlossaryRequest; -import com.google.cloud.translate.v3.DeleteGlossaryResponse; -import com.google.cloud.translate.v3.GcsSource; -import com.google.cloud.translate.v3.Glossary; -import com.google.cloud.translate.v3.GlossaryInputConfig; -import com.google.cloud.translate.v3.GlossaryName; -import com.google.cloud.translate.v3.LocationName; -import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; @@ -39,7 +26,6 @@ import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; - import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; diff --git a/translate/snippets/src/test/java/com/example/translate/QuickstartSampleIT.java b/translate/snippets/src/test/java/com/example/translate/QuickstartSampleIT.java index 78480b78fc3..a9a5fb8a42c 100644 --- a/translate/snippets/src/test/java/com/example/translate/QuickstartSampleIT.java +++ b/translate/snippets/src/test/java/com/example/translate/QuickstartSampleIT.java @@ -26,9 +26,7 @@ import org.junit.runner.RunWith; import org.junit.runners.JUnit4; -/** - * Tests for quickstart sample. - */ +/** Tests for quickstart sample. */ @RunWith(JUnit4.class) @SuppressWarnings("checkstyle:abbreviationaswordinname") public class QuickstartSampleIT { diff --git a/translate/snippets/src/test/java/com/example/translate/TranslateTextWithGlossaryAndModelTests.java b/translate/snippets/src/test/java/com/example/translate/TranslateTextWithGlossaryAndModelTests.java index dc68fa0fa92..80d269fcffe 100644 --- a/translate/snippets/src/test/java/com/example/translate/TranslateTextWithGlossaryAndModelTests.java +++ b/translate/snippets/src/test/java/com/example/translate/TranslateTextWithGlossaryAndModelTests.java @@ -19,19 +19,6 @@ import static com.google.common.truth.Truth.assertThat; import static junit.framework.TestCase.assertNotNull; -import com.google.api.gax.longrunning.OperationFuture; -import com.google.cloud.translate.v3.CreateGlossaryMetadata; -import com.google.cloud.translate.v3.CreateGlossaryRequest; -import com.google.cloud.translate.v3.DeleteGlossaryMetadata; -import com.google.cloud.translate.v3.DeleteGlossaryRequest; -import com.google.cloud.translate.v3.DeleteGlossaryResponse; -import com.google.cloud.translate.v3.GcsSource; -import com.google.cloud.translate.v3.Glossary; -import com.google.cloud.translate.v3.GlossaryInputConfig; -import com.google.cloud.translate.v3.GlossaryName; -import com.google.cloud.translate.v3.LocationName; -import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; @@ -39,7 +26,6 @@ import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; - import org.junit.After; import org.junit.Before; import org.junit.BeforeClass; diff --git a/translate/snippets/src/test/java/com/example/translate/TranslateTextWithGlossaryTests.java b/translate/snippets/src/test/java/com/example/translate/TranslateTextWithGlossaryTests.java index ad7f560195b..3b2be95994e 100644 --- a/translate/snippets/src/test/java/com/example/translate/TranslateTextWithGlossaryTests.java +++ b/translate/snippets/src/test/java/com/example/translate/TranslateTextWithGlossaryTests.java @@ -19,19 +19,6 @@ import static com.google.common.truth.Truth.assertThat; import static junit.framework.TestCase.assertNotNull; -import com.google.api.gax.longrunning.OperationFuture; -import com.google.cloud.translate.v3.CreateGlossaryMetadata; -import com.google.cloud.translate.v3.CreateGlossaryRequest; -import com.google.cloud.translate.v3.DeleteGlossaryMetadata; -import com.google.cloud.translate.v3.DeleteGlossaryRequest; -import com.google.cloud.translate.v3.DeleteGlossaryResponse; -import com.google.cloud.translate.v3.GcsSource; -import com.google.cloud.translate.v3.Glossary; -import com.google.cloud.translate.v3.GlossaryInputConfig; -import com.google.cloud.translate.v3.GlossaryName; -import com.google.cloud.translate.v3.LocationName; -import com.google.cloud.translate.v3.TranslationServiceClient; - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.PrintStream; @@ -39,7 +26,6 @@ import java.util.List; import java.util.UUID; import java.util.concurrent.ExecutionException; - import org.junit.After; import org.junit.Before; import org.junit.BeforeClass;