use of com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup 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.TransitionRouteGroup 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.TransitionRouteGroup 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);
}
use of com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup in project java-dialogflow-cx by googleapis.
the class ITSystemTest method updateTransitionRouteGroupTest.
@Test
public void updateTransitionRouteGroupTest() {
String updatedDisplayName = DISPLAY_NAME + "-" + ID;
TransitionRouteGroup transitionRouteGroup = TransitionRouteGroup.newBuilder().setName(transitionRouteGroupName).setDisplayName(updatedDisplayName).build();
FieldMask updateMask = FieldMask.newBuilder().build();
UpdateTransitionRouteGroupRequest routeGroupRequest = UpdateTransitionRouteGroupRequest.newBuilder().setTransitionRouteGroup(transitionRouteGroup).setUpdateMask(updateMask).build();
TransitionRouteGroup updatedTransitionRouteGroup = transitionRouteGroupsClient.updateTransitionRouteGroup(routeGroupRequest);
assertEquals(updatedDisplayName, updatedTransitionRouteGroup.getDisplayName());
}
use of com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroup in project java-dialogflow-cx by googleapis.
the class ITSystemTest method getTransitionRouteGroupTest.
@Test
public void getTransitionRouteGroupTest() {
GetTransitionRouteGroupRequest routeGroupRequest = GetTransitionRouteGroupRequest.newBuilder().setName(transitionRouteGroupName).build();
TransitionRouteGroup transitionRouteGroup = transitionRouteGroupsClient.getTransitionRouteGroup(routeGroupRequest);
assertTransitionRouteGroupsDetails(transitionRouteGroup);
}
Aggregations