use of com.google.cloud.dialogflow.cx.v3beta1.ListTransitionRouteGroupsRequest 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.ListTransitionRouteGroupsRequest 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.ListTransitionRouteGroupsRequest in project java-dialogflow-cx by googleapis.
the class ITSystemTest method listTransitionRouteGroupsTest.
@Test
public void listTransitionRouteGroupsTest() {
ListTransitionRouteGroupsRequest routeGroupsRequest = ListTransitionRouteGroupsRequest.newBuilder().setParent(flowName).build();
TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse pagedListResponse = transitionRouteGroupsClient.listTransitionRouteGroups(routeGroupsRequest);
List<TransitionRouteGroup> routeGroups = Lists.newArrayList(pagedListResponse.iterateAll());
boolean isTransitionRouteGroupNameExists = false;
for (TransitionRouteGroup routeGroup : routeGroups) {
if (routeGroup.getName().equals(transitionRouteGroupName)) {
assertTransitionRouteGroupsDetails(routeGroup);
isTransitionRouteGroupNameExists = true;
}
}
assertTrue(isTransitionRouteGroupNameExists);
}
Aggregations