Search in sources :

Example 1 with ListTransitionRouteGroupsPagedResponse

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()));
}
Also used : ListTransitionRouteGroupsPagedResponse(com.google.cloud.dialogflow.cx.v3.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse) AbstractMessage(com.google.protobuf.AbstractMessage) Test(org.junit.Test)

Example 2 with ListTransitionRouteGroupsPagedResponse

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()));
}
Also used : ListTransitionRouteGroupsPagedResponse(com.google.cloud.dialogflow.cx.v3.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse) AbstractMessage(com.google.protobuf.AbstractMessage) Test(org.junit.Test)

Example 3 with ListTransitionRouteGroupsPagedResponse

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()));
}
Also used : ListTransitionRouteGroupsPagedResponse(com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse) AbstractMessage(com.google.protobuf.AbstractMessage) Test(org.junit.Test)

Example 4 with ListTransitionRouteGroupsPagedResponse

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()));
}
Also used : ListTransitionRouteGroupsPagedResponse(com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse) AbstractMessage(com.google.protobuf.AbstractMessage) Test(org.junit.Test)

Aggregations

AbstractMessage (com.google.protobuf.AbstractMessage)4 Test (org.junit.Test)4 ListTransitionRouteGroupsPagedResponse (com.google.cloud.dialogflow.cx.v3.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse)2 ListTransitionRouteGroupsPagedResponse (com.google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroupsClient.ListTransitionRouteGroupsPagedResponse)2