use of com.google.container.v1beta1.ListNodePoolsRequest in project java-container by googleapis.
the class ClusterManagerClientTest method listNodePoolsTest.
@Test
public void listNodePoolsTest() throws Exception {
ListNodePoolsResponse expectedResponse = ListNodePoolsResponse.newBuilder().addAllNodePools(new ArrayList<NodePool>()).build();
mockClusterManager.addResponse(expectedResponse);
String parent = "parent-995424086";
ListNodePoolsResponse actualResponse = client.listNodePools(parent);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListNodePoolsRequest actualRequest = ((ListNodePoolsRequest) actualRequests.get(0));
Assert.assertEquals(parent, actualRequest.getParent());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.container.v1beta1.ListNodePoolsRequest in project java-container by googleapis.
the class ClusterManagerClientTest method listNodePoolsTest.
@Test
public void listNodePoolsTest() throws Exception {
ListNodePoolsResponse expectedResponse = ListNodePoolsResponse.newBuilder().addAllNodePools(new ArrayList<NodePool>()).build();
mockClusterManager.addResponse(expectedResponse);
String projectId = "projectId-894832108";
String zone = "zone3744684";
String clusterId = "clusterId561939637";
ListNodePoolsResponse actualResponse = client.listNodePools(projectId, zone, clusterId);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListNodePoolsRequest actualRequest = ((ListNodePoolsRequest) actualRequests.get(0));
Assert.assertEquals(projectId, actualRequest.getProjectId());
Assert.assertEquals(zone, actualRequest.getZone());
Assert.assertEquals(clusterId, actualRequest.getClusterId());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.container.v1beta1.ListNodePoolsRequest in project java-container by googleapis.
the class ClusterManagerClientTest method listNodePoolsTest2.
@Test
public void listNodePoolsTest2() throws Exception {
ListNodePoolsResponse expectedResponse = ListNodePoolsResponse.newBuilder().addAllNodePools(new ArrayList<NodePool>()).build();
mockClusterManager.addResponse(expectedResponse);
String projectId = "projectId-894832108";
String zone = "zone3744684";
String clusterId = "clusterId561939637";
ListNodePoolsResponse actualResponse = client.listNodePools(projectId, zone, clusterId);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListNodePoolsRequest actualRequest = ((ListNodePoolsRequest) actualRequests.get(0));
Assert.assertEquals(projectId, actualRequest.getProjectId());
Assert.assertEquals(zone, actualRequest.getZone());
Assert.assertEquals(clusterId, actualRequest.getClusterId());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Aggregations