use of com.google.container.v1beta1.ListNodePoolsResponse in project java-container by googleapis.
the class ITSystemTest method listNodePoolsTest.
@Test
public void listNodePoolsTest() {
ListNodePoolsResponse response = client.listNodePools(PROJECT_ID, ZONE, CLUSTER_NAME);
List<NodePool> nodePools = response.getNodePoolsList();
for (NodePool nodePool : nodePools) {
if (NODE_POOL_NAME.equals(nodePool.getName())) {
assertEquals(NODE_POOL_NAME, nodePool.getName());
assertEquals(INITIAL_NODE_COUNT, nodePool.getInitialNodeCount());
assertEquals(NODE_POOL_SEL_LINK, nodePool.getSelfLink());
}
}
}
use of com.google.container.v1beta1.ListNodePoolsResponse 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.ListNodePoolsResponse 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.ListNodePoolsResponse 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