use of com.google.cloud.dialogflow.v2.ConversationProfilesClient.ListConversationProfilesPagedResponse in project java-dialogflow by googleapis.
the class ConversationProfilesClientTest method listConversationProfilesTest3.
@Test
public void listConversationProfilesTest3() throws Exception {
ConversationProfile responsesElement = ConversationProfile.newBuilder().build();
ListConversationProfilesResponse expectedResponse = ListConversationProfilesResponse.newBuilder().setNextPageToken("").addAllConversationProfiles(Arrays.asList(responsesElement)).build();
mockConversationProfiles.addResponse(expectedResponse);
String parent = "parent-995424086";
ListConversationProfilesPagedResponse pagedListResponse = client.listConversationProfiles(parent);
List<ConversationProfile> resources = Lists.newArrayList(pagedListResponse.iterateAll());
Assert.assertEquals(1, resources.size());
Assert.assertEquals(expectedResponse.getConversationProfilesList().get(0), resources.get(0));
List<AbstractMessage> actualRequests = mockConversationProfiles.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListConversationProfilesRequest actualRequest = ((ListConversationProfilesRequest) actualRequests.get(0));
Assert.assertEquals(parent, actualRequest.getParent());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.cloud.dialogflow.v2.ConversationProfilesClient.ListConversationProfilesPagedResponse in project java-dialogflow by googleapis.
the class ConversationProfilesClientTest method listConversationProfilesTest.
@Test
public void listConversationProfilesTest() throws Exception {
ConversationProfile responsesElement = ConversationProfile.newBuilder().build();
ListConversationProfilesResponse expectedResponse = ListConversationProfilesResponse.newBuilder().setNextPageToken("").addAllConversationProfiles(Arrays.asList(responsesElement)).build();
mockConversationProfiles.addResponse(expectedResponse);
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
ListConversationProfilesPagedResponse pagedListResponse = client.listConversationProfiles(parent);
List<ConversationProfile> resources = Lists.newArrayList(pagedListResponse.iterateAll());
Assert.assertEquals(1, resources.size());
Assert.assertEquals(expectedResponse.getConversationProfilesList().get(0), resources.get(0));
List<AbstractMessage> actualRequests = mockConversationProfiles.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListConversationProfilesRequest actualRequest = ((ListConversationProfilesRequest) actualRequests.get(0));
Assert.assertEquals(parent.toString(), actualRequest.getParent());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.cloud.dialogflow.v2.ConversationProfilesClient.ListConversationProfilesPagedResponse in project java-dialogflow by googleapis.
the class ConversationProfilesClientTest method listConversationProfilesTest3.
@Test
public void listConversationProfilesTest3() throws Exception {
ConversationProfile responsesElement = ConversationProfile.newBuilder().build();
ListConversationProfilesResponse expectedResponse = ListConversationProfilesResponse.newBuilder().setNextPageToken("").addAllConversationProfiles(Arrays.asList(responsesElement)).build();
mockConversationProfiles.addResponse(expectedResponse);
String parent = "parent-995424086";
ListConversationProfilesPagedResponse pagedListResponse = client.listConversationProfiles(parent);
List<ConversationProfile> resources = Lists.newArrayList(pagedListResponse.iterateAll());
Assert.assertEquals(1, resources.size());
Assert.assertEquals(expectedResponse.getConversationProfilesList().get(0), resources.get(0));
List<AbstractMessage> actualRequests = mockConversationProfiles.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListConversationProfilesRequest actualRequest = ((ListConversationProfilesRequest) actualRequests.get(0));
Assert.assertEquals(parent, actualRequest.getParent());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.cloud.dialogflow.v2.ConversationProfilesClient.ListConversationProfilesPagedResponse in project java-dialogflow by googleapis.
the class ConversationProfilesClientTest method listConversationProfilesTest2.
@Test
public void listConversationProfilesTest2() throws Exception {
ConversationProfile responsesElement = ConversationProfile.newBuilder().build();
ListConversationProfilesResponse expectedResponse = ListConversationProfilesResponse.newBuilder().setNextPageToken("").addAllConversationProfiles(Arrays.asList(responsesElement)).build();
mockConversationProfiles.addResponse(expectedResponse);
ProjectName parent = ProjectName.of("[PROJECT]");
ListConversationProfilesPagedResponse pagedListResponse = client.listConversationProfiles(parent);
List<ConversationProfile> resources = Lists.newArrayList(pagedListResponse.iterateAll());
Assert.assertEquals(1, resources.size());
Assert.assertEquals(expectedResponse.getConversationProfilesList().get(0), resources.get(0));
List<AbstractMessage> actualRequests = mockConversationProfiles.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListConversationProfilesRequest actualRequest = ((ListConversationProfilesRequest) actualRequests.get(0));
Assert.assertEquals(parent.toString(), actualRequest.getParent());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.cloud.dialogflow.v2.ConversationProfilesClient.ListConversationProfilesPagedResponse in project java-dialogflow by googleapis.
the class ConversationProfilesClientTest method listConversationProfilesTest.
@Test
public void listConversationProfilesTest() throws Exception {
ConversationProfile responsesElement = ConversationProfile.newBuilder().build();
ListConversationProfilesResponse expectedResponse = ListConversationProfilesResponse.newBuilder().setNextPageToken("").addAllConversationProfiles(Arrays.asList(responsesElement)).build();
mockConversationProfiles.addResponse(expectedResponse);
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
ListConversationProfilesPagedResponse pagedListResponse = client.listConversationProfiles(parent);
List<ConversationProfile> resources = Lists.newArrayList(pagedListResponse.iterateAll());
Assert.assertEquals(1, resources.size());
Assert.assertEquals(expectedResponse.getConversationProfilesList().get(0), resources.get(0));
List<AbstractMessage> actualRequests = mockConversationProfiles.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListConversationProfilesRequest actualRequest = ((ListConversationProfilesRequest) actualRequests.get(0));
Assert.assertEquals(parent.toString(), actualRequest.getParent());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Aggregations