From dbcd39944462c92688ae99128ea479796d5d9ce7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 3 Sep 2021 18:18:15 +0000 Subject: [PATCH] chore(java): install maven 3.8.1 at runtime (#1202) (#689) --- .../com/example/dialogflow/UpdateIntent.java | 17 ++++------------- .../com/example/dialogflow/UpdateIntentIT.java | 16 ++++------------ 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/dialogflow/snippets/src/main/java/com/example/dialogflow/UpdateIntent.java b/dialogflow/snippets/src/main/java/com/example/dialogflow/UpdateIntent.java index 1034db70af8..8b18afe7e75 100644 --- a/dialogflow/snippets/src/main/java/com/example/dialogflow/UpdateIntent.java +++ b/dialogflow/snippets/src/main/java/com/example/dialogflow/UpdateIntent.java @@ -24,7 +24,6 @@ import com.google.protobuf.FieldMask; import java.io.IOException; - public class UpdateIntent { public static void main(String[] args) throws IOException { @@ -38,23 +37,15 @@ public static void main(String[] args) throws IOException { // DialogFlow API Update Intent sample. public static void updateIntent( - String projectId, String intentId, String location, String displayName) - throws IOException { + String projectId, String intentId, String location, String displayName) throws IOException { try (IntentsClient client = IntentsClient.create()) { String intentPath = - "projects/" - + projectId - + "/locations/" - + location - + "/agent/intents/" - + intentId; + "projects/" + projectId + "/locations/" + location + "/agent/intents/" + intentId; Builder intentBuilder = client.getIntent(intentPath).toBuilder(); intentBuilder.setDisplayName(displayName); - FieldMask fieldMask = FieldMask.newBuilder() - .addPaths("display_name") - .build(); + FieldMask fieldMask = FieldMask.newBuilder().addPaths("display_name").build(); Intent intent = intentBuilder.build(); UpdateIntentRequest request = @@ -70,4 +61,4 @@ public static void updateIntent( } } } -// [END dialogflow_es_update_intent] \ No newline at end of file +// [END dialogflow_es_update_intent] diff --git a/dialogflow/snippets/src/test/java/com/example/dialogflow/UpdateIntentIT.java b/dialogflow/snippets/src/test/java/com/example/dialogflow/UpdateIntentIT.java index c7f3ba0f52f..84d9cfb08fd 100644 --- a/dialogflow/snippets/src/test/java/com/example/dialogflow/UpdateIntentIT.java +++ b/dialogflow/snippets/src/test/java/com/example/dialogflow/UpdateIntentIT.java @@ -18,10 +18,6 @@ import static com.google.common.truth.Truth.assertThat; -import com.google.cloud.dialogflow.v2.Agent; -import com.google.cloud.dialogflow.v2.Agent.Builder; -import com.google.cloud.dialogflow.v2.AgentsClient; -import com.google.cloud.dialogflow.v2.AgentsSettings; import com.google.cloud.dialogflow.v2.Intent; import com.google.cloud.dialogflow.v2.IntentsClient; import java.io.ByteArrayOutputStream; @@ -64,11 +60,8 @@ public void tearDown() throws IOException { IntentsClient client = IntentsClient.create(); - String intentPath = - "projects/" - + PROJECT_ID - + "/locations/global/agent/intents/" - + UpdateIntentIT.intentID; + String intentPath = + "projects/" + PROJECT_ID + "/locations/global/agent/intents/" + UpdateIntentIT.intentID; client.deleteIntent(intentPath); } @@ -78,9 +71,8 @@ public void testUpdateIntent() throws IOException { String fakeIntent = "fake_intent_" + UUID.randomUUID().toString(); - UpdateIntent.updateIntent( - PROJECT_ID, UpdateIntentIT.intentID, "global", fakeIntent); + UpdateIntent.updateIntent(PROJECT_ID, UpdateIntentIT.intentID, "global", fakeIntent); assertThat(stdOut.toString()).contains(fakeIntent); } -} \ No newline at end of file +}