use of com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse in project java-dialogflow-cx by googleapis.
the class TransitionRouteGroupsClientTest method listTransitionRouteGroupsTest2.
@Test
public void listTransitionRouteGroupsTest2() throws Exception {
TransitionRouteGroup responsesElement = TransitionRouteGroup.newBuilder().build();
ListTransitionRouteGroupsResponse expectedResponse = ListTransitionRouteGroupsResponse.newBuilder().setNextPageToken("").addAllTransitionRouteGroups(Arrays.asList(responsesElement)).build();
mockTransitionRouteGroups.addResponse(expectedResponse);
String parent = "parent-995424086";
ListTransitionRouteGroupsPagedResponse pagedListResponse = client.listTransitionRouteGroups(parent);
List<TransitionRouteGroup> resources = Lists.newArrayList(pagedListResponse.iterateAll());
Assert.assertEquals(1, resources.size());
Assert.assertEquals(expectedResponse.getTransitionRouteGroupsList().get(0), resources.get(0));
List<AbstractMessage> actualRequests = mockTransitionRouteGroups.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListTransitionRouteGroupsRequest actualRequest = ((ListTransitionRouteGroupsRequest) actualRequests.get(0));
Assert.assertEquals(parent, actualRequest.getParent());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse in project java-dialogflow-cx by googleapis.
the class TransitionRouteGroupsClientTest method listTransitionRouteGroupsTest.
@Test
public void listTransitionRouteGroupsTest() throws Exception {
TransitionRouteGroup responsesElement = TransitionRouteGroup.newBuilder().build();
ListTransitionRouteGroupsResponse expectedResponse = ListTransitionRouteGroupsResponse.newBuilder().setNextPageToken("").addAllTransitionRouteGroups(Arrays.asList(responsesElement)).build();
mockTransitionRouteGroups.addResponse(expectedResponse);
FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
ListTransitionRouteGroupsPagedResponse pagedListResponse = client.listTransitionRouteGroups(parent);
List<TransitionRouteGroup> resources = Lists.newArrayList(pagedListResponse.iterateAll());
Assert.assertEquals(1, resources.size());
Assert.assertEquals(expectedResponse.getTransitionRouteGroupsList().get(0), resources.get(0));
List<AbstractMessage> actualRequests = mockTransitionRouteGroups.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListTransitionRouteGroupsRequest actualRequest = ((ListTransitionRouteGroupsRequest) 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.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse in project java-dialogflow-cx by googleapis.
the class TransitionRouteGroupsClientTest method listTransitionRouteGroupsTest2.
@Test
public void listTransitionRouteGroupsTest2() throws Exception {
TransitionRouteGroup responsesElement = TransitionRouteGroup.newBuilder().build();
ListTransitionRouteGroupsResponse expectedResponse = ListTransitionRouteGroupsResponse.newBuilder().setNextPageToken("").addAllTransitionRouteGroups(Arrays.asList(responsesElement)).build();
mockTransitionRouteGroups.addResponse(expectedResponse);
String parent = "parent-995424086";
ListTransitionRouteGroupsPagedResponse pagedListResponse = client.listTransitionRouteGroups(parent);
List<TransitionRouteGroup> resources = Lists.newArrayList(pagedListResponse.iterateAll());
Assert.assertEquals(1, resources.size());
Assert.assertEquals(expectedResponse.getTransitionRouteGroupsList().get(0), resources.get(0));
List<AbstractMessage> actualRequests = mockTransitionRouteGroups.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListTransitionRouteGroupsRequest actualRequest = ((ListTransitionRouteGroupsRequest) actualRequests.get(0));
Assert.assertEquals(parent, actualRequest.getParent());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse in project java-dialogflow-cx by googleapis.
the class TransitionRouteGroupsClientTest method listTransitionRouteGroupsTest.
@Test
public void listTransitionRouteGroupsTest() throws Exception {
TransitionRouteGroup responsesElement = TransitionRouteGroup.newBuilder().build();
ListTransitionRouteGroupsResponse expectedResponse = ListTransitionRouteGroupsResponse.newBuilder().setNextPageToken("").addAllTransitionRouteGroups(Arrays.asList(responsesElement)).build();
mockTransitionRouteGroups.addResponse(expectedResponse);
FlowName parent = FlowName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[FLOW]");
ListTransitionRouteGroupsPagedResponse pagedListResponse = client.listTransitionRouteGroups(parent);
List<TransitionRouteGroup> resources = Lists.newArrayList(pagedListResponse.iterateAll());
Assert.assertEquals(1, resources.size());
Assert.assertEquals(expectedResponse.getTransitionRouteGroupsList().get(0), resources.get(0));
List<AbstractMessage> actualRequests = mockTransitionRouteGroups.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListTransitionRouteGroupsRequest actualRequest = ((ListTransitionRouteGroupsRequest) actualRequests.get(0));
Assert.assertEquals(parent.toString(), actualRequest.getParent());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Aggregations