use of com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.ListContinuousTestResultsPagedResponse in project java-dialogflow-cx by googleapis.
the class EnvironmentsClientTest method listContinuousTestResultsTest2.
@Test
public void listContinuousTestResultsTest2() throws Exception {
ContinuousTestResult responsesElement = ContinuousTestResult.newBuilder().build();
ListContinuousTestResultsResponse expectedResponse = ListContinuousTestResultsResponse.newBuilder().setNextPageToken("").addAllContinuousTestResults(Arrays.asList(responsesElement)).build();
mockEnvironments.addResponse(expectedResponse);
String parent = "parent-995424086";
ListContinuousTestResultsPagedResponse pagedListResponse = client.listContinuousTestResults(parent);
List<ContinuousTestResult> resources = Lists.newArrayList(pagedListResponse.iterateAll());
Assert.assertEquals(1, resources.size());
Assert.assertEquals(expectedResponse.getContinuousTestResultsList().get(0), resources.get(0));
List<AbstractMessage> actualRequests = mockEnvironments.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListContinuousTestResultsRequest actualRequest = ((ListContinuousTestResultsRequest) actualRequests.get(0));
Assert.assertEquals(parent, actualRequest.getParent());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.ListContinuousTestResultsPagedResponse in project java-dialogflow-cx by googleapis.
the class EnvironmentsClientTest method listContinuousTestResultsTest.
@Test
public void listContinuousTestResultsTest() throws Exception {
ContinuousTestResult responsesElement = ContinuousTestResult.newBuilder().build();
ListContinuousTestResultsResponse expectedResponse = ListContinuousTestResultsResponse.newBuilder().setNextPageToken("").addAllContinuousTestResults(Arrays.asList(responsesElement)).build();
mockEnvironments.addResponse(expectedResponse);
EnvironmentName parent = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
ListContinuousTestResultsPagedResponse pagedListResponse = client.listContinuousTestResults(parent);
List<ContinuousTestResult> resources = Lists.newArrayList(pagedListResponse.iterateAll());
Assert.assertEquals(1, resources.size());
Assert.assertEquals(expectedResponse.getContinuousTestResultsList().get(0), resources.get(0));
List<AbstractMessage> actualRequests = mockEnvironments.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListContinuousTestResultsRequest actualRequest = ((ListContinuousTestResultsRequest) actualRequests.get(0));
Assert.assertEquals(parent.toString(), actualRequest.getParent());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.ListContinuousTestResultsPagedResponse in project java-dialogflow-cx by googleapis.
the class EnvironmentsClientTest method listContinuousTestResultsTest.
@Test
public void listContinuousTestResultsTest() throws Exception {
ContinuousTestResult responsesElement = ContinuousTestResult.newBuilder().build();
ListContinuousTestResultsResponse expectedResponse = ListContinuousTestResultsResponse.newBuilder().setNextPageToken("").addAllContinuousTestResults(Arrays.asList(responsesElement)).build();
mockEnvironments.addResponse(expectedResponse);
EnvironmentName parent = EnvironmentName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENVIRONMENT]");
ListContinuousTestResultsPagedResponse pagedListResponse = client.listContinuousTestResults(parent);
List<ContinuousTestResult> resources = Lists.newArrayList(pagedListResponse.iterateAll());
Assert.assertEquals(1, resources.size());
Assert.assertEquals(expectedResponse.getContinuousTestResultsList().get(0), resources.get(0));
List<AbstractMessage> actualRequests = mockEnvironments.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListContinuousTestResultsRequest actualRequest = ((ListContinuousTestResultsRequest) actualRequests.get(0));
Assert.assertEquals(parent.toString(), actualRequest.getParent());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.cloud.dialogflow.cx.v3beta1.EnvironmentsClient.ListContinuousTestResultsPagedResponse in project java-dialogflow-cx by googleapis.
the class EnvironmentsClientTest method listContinuousTestResultsTest2.
@Test
public void listContinuousTestResultsTest2() throws Exception {
ContinuousTestResult responsesElement = ContinuousTestResult.newBuilder().build();
ListContinuousTestResultsResponse expectedResponse = ListContinuousTestResultsResponse.newBuilder().setNextPageToken("").addAllContinuousTestResults(Arrays.asList(responsesElement)).build();
mockEnvironments.addResponse(expectedResponse);
String parent = "parent-995424086";
ListContinuousTestResultsPagedResponse pagedListResponse = client.listContinuousTestResults(parent);
List<ContinuousTestResult> resources = Lists.newArrayList(pagedListResponse.iterateAll());
Assert.assertEquals(1, resources.size());
Assert.assertEquals(expectedResponse.getContinuousTestResultsList().get(0), resources.get(0));
List<AbstractMessage> actualRequests = mockEnvironments.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListContinuousTestResultsRequest actualRequest = ((ListContinuousTestResultsRequest) actualRequests.get(0));
Assert.assertEquals(parent, actualRequest.getParent());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Aggregations