Skip to content

Commit

Permalink
chore(java): install maven 3.8.1 at runtime (#1202) (#689)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] authored Sep 3, 2021
1 parent 244ada0 commit dbcd399
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.google.protobuf.FieldMask;
import java.io.IOException;


public class UpdateIntent {

public static void main(String[] args) throws IOException {
Expand All @@ -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 =
Expand All @@ -70,4 +61,4 @@ public static void updateIntent(
}
}
}
// [END dialogflow_es_update_intent]
// [END dialogflow_es_update_intent]
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
}
}

0 comments on commit dbcd399

Please sign in to comment.