Skip to content

Commit dbcd399

Browse files
chore(java): install maven 3.8.1 at runtime (#1202) (#689)
1 parent 244ada0 commit dbcd399

File tree

2 files changed

+8
-25
lines changed

2 files changed

+8
-25
lines changed

dialogflow/snippets/src/main/java/com/example/dialogflow/UpdateIntent.java

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import com.google.protobuf.FieldMask;
2525
import java.io.IOException;
2626

27-
2827
public class UpdateIntent {
2928

3029
public static void main(String[] args) throws IOException {
@@ -38,23 +37,15 @@ public static void main(String[] args) throws IOException {
3837

3938
// DialogFlow API Update Intent sample.
4039
public static void updateIntent(
41-
String projectId, String intentId, String location, String displayName)
42-
throws IOException {
40+
String projectId, String intentId, String location, String displayName) throws IOException {
4341
try (IntentsClient client = IntentsClient.create()) {
4442
String intentPath =
45-
"projects/"
46-
+ projectId
47-
+ "/locations/"
48-
+ location
49-
+ "/agent/intents/"
50-
+ intentId;
43+
"projects/" + projectId + "/locations/" + location + "/agent/intents/" + intentId;
5144

5245
Builder intentBuilder = client.getIntent(intentPath).toBuilder();
5346

5447
intentBuilder.setDisplayName(displayName);
55-
FieldMask fieldMask = FieldMask.newBuilder()
56-
.addPaths("display_name")
57-
.build();
48+
FieldMask fieldMask = FieldMask.newBuilder().addPaths("display_name").build();
5849

5950
Intent intent = intentBuilder.build();
6051
UpdateIntentRequest request =
@@ -70,4 +61,4 @@ public static void updateIntent(
7061
}
7162
}
7263
}
73-
// [END dialogflow_es_update_intent]
64+
// [END dialogflow_es_update_intent]

dialogflow/snippets/src/test/java/com/example/dialogflow/UpdateIntentIT.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@
1818

1919
import static com.google.common.truth.Truth.assertThat;
2020

21-
import com.google.cloud.dialogflow.v2.Agent;
22-
import com.google.cloud.dialogflow.v2.Agent.Builder;
23-
import com.google.cloud.dialogflow.v2.AgentsClient;
24-
import com.google.cloud.dialogflow.v2.AgentsSettings;
2521
import com.google.cloud.dialogflow.v2.Intent;
2622
import com.google.cloud.dialogflow.v2.IntentsClient;
2723
import java.io.ByteArrayOutputStream;
@@ -64,11 +60,8 @@ public void tearDown() throws IOException {
6460

6561
IntentsClient client = IntentsClient.create();
6662

67-
String intentPath =
68-
"projects/"
69-
+ PROJECT_ID
70-
+ "/locations/global/agent/intents/"
71-
+ UpdateIntentIT.intentID;
63+
String intentPath =
64+
"projects/" + PROJECT_ID + "/locations/global/agent/intents/" + UpdateIntentIT.intentID;
7265

7366
client.deleteIntent(intentPath);
7467
}
@@ -78,9 +71,8 @@ public void testUpdateIntent() throws IOException {
7871

7972
String fakeIntent = "fake_intent_" + UUID.randomUUID().toString();
8073

81-
UpdateIntent.updateIntent(
82-
PROJECT_ID, UpdateIntentIT.intentID, "global", fakeIntent);
74+
UpdateIntent.updateIntent(PROJECT_ID, UpdateIntentIT.intentID, "global", fakeIntent);
8375

8476
assertThat(stdOut.toString()).contains(fakeIntent);
8577
}
86-
}
78+
}

0 commit comments

Comments
 (0)