Search in sources :

Example 1 with ListNodePoolsRequest

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()));
}
Also used : ListNodePoolsRequest(com.google.container.v1.ListNodePoolsRequest) AbstractMessage(com.google.protobuf.AbstractMessage) ArrayList(java.util.ArrayList) ListNodePoolsResponse(com.google.container.v1.ListNodePoolsResponse) Test(org.junit.Test)

Example 2 with ListNodePoolsRequest

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()));
}
Also used : ListNodePoolsRequest(com.google.container.v1beta1.ListNodePoolsRequest) AbstractMessage(com.google.protobuf.AbstractMessage) ArrayList(java.util.ArrayList) ListNodePoolsResponse(com.google.container.v1beta1.ListNodePoolsResponse) Test(org.junit.Test)

Example 3 with ListNodePoolsRequest

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()));
}
Also used : ListNodePoolsRequest(com.google.container.v1.ListNodePoolsRequest) AbstractMessage(com.google.protobuf.AbstractMessage) ArrayList(java.util.ArrayList) ListNodePoolsResponse(com.google.container.v1.ListNodePoolsResponse) Test(org.junit.Test)

Aggregations

AbstractMessage (com.google.protobuf.AbstractMessage)3 ArrayList (java.util.ArrayList)3 Test (org.junit.Test)3 ListNodePoolsRequest (com.google.container.v1.ListNodePoolsRequest)2 ListNodePoolsResponse (com.google.container.v1.ListNodePoolsResponse)2 ListNodePoolsRequest (com.google.container.v1beta1.ListNodePoolsRequest)1 ListNodePoolsResponse (com.google.container.v1beta1.ListNodePoolsResponse)1