use of com.google.container.v1beta1.ListOperationsResponse in project java-container by googleapis.
the class ClusterManagerClientTest method listOperationsTest.
@Test
public void listOperationsTest() throws Exception {
ListOperationsResponse expectedResponse = ListOperationsResponse.newBuilder().addAllOperations(new ArrayList<Operation>()).addAllMissingZones(new ArrayList<String>()).build();
mockClusterManager.addResponse(expectedResponse);
String projectId = "projectId-894832108";
String zone = "zone3744684";
ListOperationsResponse actualResponse = client.listOperations(projectId, zone);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListOperationsRequest actualRequest = ((ListOperationsRequest) actualRequests.get(0));
Assert.assertEquals(projectId, actualRequest.getProjectId());
Assert.assertEquals(zone, actualRequest.getZone());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.container.v1beta1.ListOperationsResponse in project java-container by googleapis.
the class ClusterManagerClientTest method listOperationsTest.
@Test
public void listOperationsTest() throws Exception {
ListOperationsResponse expectedResponse = ListOperationsResponse.newBuilder().addAllOperations(new ArrayList<Operation>()).addAllMissingZones(new ArrayList<String>()).build();
mockClusterManager.addResponse(expectedResponse);
String projectId = "projectId-894832108";
String zone = "zone3744684";
ListOperationsResponse actualResponse = client.listOperations(projectId, zone);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
Assert.assertEquals(1, actualRequests.size());
ListOperationsRequest actualRequest = ((ListOperationsRequest) actualRequests.get(0));
Assert.assertEquals(projectId, actualRequest.getProjectId());
Assert.assertEquals(zone, actualRequest.getZone());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.container.v1beta1.ListOperationsResponse in project java-container by googleapis.
the class ITSystemTest method listOperationsTest.
@Test
public void listOperationsTest() {
ListOperationsResponse listOperations = client.listOperations(PROJECT_ID, ZONE);
List<Operation> operations = listOperations.getOperationsList();
for (Operation actualOperation : operations) {
if (actualOperation.getName().equals(operation.getName())) {
assertEquals(operation.getName(), actualOperation.getName());
assertEquals(ZONE, actualOperation.getZone());
}
}
}
Aggregations