dialogflow: increase timeout for test by nnegrey · Pull Request #2136 · GoogleCloudPlatform/java-docs-samples · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dialogflow/cloud-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public static Document createDocument(
.build();
OperationFuture<Document, KnowledgeOperationMetadata> response =
documentsClient.createDocumentAsync(createDocumentRequest);
Document createdDocument = response.get(120, TimeUnit.SECONDS);
Document createdDocument = response.get(180, TimeUnit.SECONDS);
System.out.format("Created Document:\n");
System.out.format(" - Display Name: %s\n", createdDocument.getDisplayName());
System.out.format(" - Knowledge ID: %s\n", createdDocument.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@

package com.example.dialogflow;

import static org.junit.Assert.assertThat;
import static com.google.common.truth.Truth.assertThat;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.UUID;

import org.hamcrest.CoreMatchers;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
Expand Down Expand Up @@ -58,14 +56,11 @@ public void tearDown() {
@Test
public void testStreamingDetectIntentCallable() {
DetectIntentStream.detectIntentStream(
PROJECT_ID, audioFilePath, SESSION_ID);
PROJECT_ID, audioFilePath, SESSION_ID);

String output = bout.toString();

assertThat(output, CoreMatchers.containsString(
"Intent Display Name: room.reservation"));

assertThat(output, CoreMatchers.containsString(
"book"));
assertThat(output).contains("Intent Display Name: room.reservation");
assertThat(output).contains("book");
}
}