Search in sources :

Example 96 with Operation

use of org.geosdi.geoplatform.xml.ows.v100.Operation in project java-container by googleapis.

the class ClusterManagerClientTest method completeIPRotationTest.

@Test
public void completeIPRotationTest() throws Exception {
    Operation expectedResponse = Operation.newBuilder().setName("name3373707").setZone("zone3744684").setDetail("detail-1335224239").setStatusMessage("statusMessage-958704715").setSelfLink("selfLink1191800166").setTargetLink("targetLink486368555").setLocation("location1901043637").setStartTime("startTime-2129294769").setEndTime("endTime-1607243192").setProgress(OperationProgress.newBuilder().build()).addAllClusterConditions(new ArrayList<StatusCondition>()).addAllNodepoolConditions(new ArrayList<StatusCondition>()).setError(Status.newBuilder().build()).build();
    mockClusterManager.addResponse(expectedResponse);
    String projectId = "projectId-894832108";
    String zone = "zone3744684";
    String clusterId = "clusterId561939637";
    Operation actualResponse = client.completeIPRotation(projectId, zone, clusterId);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    CompleteIPRotationRequest actualRequest = ((CompleteIPRotationRequest) 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 : CompleteIPRotationRequest(com.google.container.v1beta1.CompleteIPRotationRequest) AbstractMessage(com.google.protobuf.AbstractMessage) ArrayList(java.util.ArrayList) Operation(com.google.container.v1beta1.Operation) StatusCondition(com.google.container.v1beta1.StatusCondition) Test(org.junit.Test)

Example 97 with Operation

use of org.geosdi.geoplatform.xml.ows.v100.Operation in project java-container by googleapis.

the class ClusterManagerClientTest method getOperationTest.

@Test
public void getOperationTest() throws Exception {
    Operation expectedResponse = Operation.newBuilder().setName("name3373707").setZone("zone3744684").setDetail("detail-1335224239").setStatusMessage("statusMessage-958704715").setSelfLink("selfLink1191800166").setTargetLink("targetLink486368555").setLocation("location1901043637").setStartTime("startTime-2129294769").setEndTime("endTime-1607243192").setProgress(OperationProgress.newBuilder().build()).addAllClusterConditions(new ArrayList<StatusCondition>()).addAllNodepoolConditions(new ArrayList<StatusCondition>()).setError(Status.newBuilder().build()).build();
    mockClusterManager.addResponse(expectedResponse);
    String projectId = "projectId-894832108";
    String zone = "zone3744684";
    String operationId = "operationId129704162";
    Operation actualResponse = client.getOperation(projectId, zone, operationId);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    GetOperationRequest actualRequest = ((GetOperationRequest) actualRequests.get(0));
    Assert.assertEquals(projectId, actualRequest.getProjectId());
    Assert.assertEquals(zone, actualRequest.getZone());
    Assert.assertEquals(operationId, actualRequest.getOperationId());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : AbstractMessage(com.google.protobuf.AbstractMessage) GetOperationRequest(com.google.container.v1beta1.GetOperationRequest) ArrayList(java.util.ArrayList) Operation(com.google.container.v1beta1.Operation) StatusCondition(com.google.container.v1beta1.StatusCondition) Test(org.junit.Test)

Example 98 with Operation

use of org.geosdi.geoplatform.xml.ows.v100.Operation in project java-container by googleapis.

the class ClusterManagerClientTest method setLegacyAbacTest.

@Test
public void setLegacyAbacTest() throws Exception {
    Operation expectedResponse = Operation.newBuilder().setName("name3373707").setZone("zone3744684").setDetail("detail-1335224239").setStatusMessage("statusMessage-958704715").setSelfLink("selfLink1191800166").setTargetLink("targetLink486368555").setLocation("location1901043637").setStartTime("startTime-2129294769").setEndTime("endTime-1607243192").setProgress(OperationProgress.newBuilder().build()).addAllClusterConditions(new ArrayList<StatusCondition>()).addAllNodepoolConditions(new ArrayList<StatusCondition>()).setError(Status.newBuilder().build()).build();
    mockClusterManager.addResponse(expectedResponse);
    String projectId = "projectId-894832108";
    String zone = "zone3744684";
    String clusterId = "clusterId561939637";
    boolean enabled = true;
    Operation actualResponse = client.setLegacyAbac(projectId, zone, clusterId, enabled);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    SetLegacyAbacRequest actualRequest = ((SetLegacyAbacRequest) actualRequests.get(0));
    Assert.assertEquals(projectId, actualRequest.getProjectId());
    Assert.assertEquals(zone, actualRequest.getZone());
    Assert.assertEquals(clusterId, actualRequest.getClusterId());
    Assert.assertEquals(enabled, actualRequest.getEnabled());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : AbstractMessage(com.google.protobuf.AbstractMessage) SetLegacyAbacRequest(com.google.container.v1beta1.SetLegacyAbacRequest) ArrayList(java.util.ArrayList) Operation(com.google.container.v1beta1.Operation) StatusCondition(com.google.container.v1beta1.StatusCondition) Test(org.junit.Test)

Example 99 with Operation

use of org.geosdi.geoplatform.xml.ows.v100.Operation in project java-container by googleapis.

the class ClusterManagerClientTest method setNodePoolManagementTest.

@Test
public void setNodePoolManagementTest() throws Exception {
    Operation expectedResponse = Operation.newBuilder().setName("name3373707").setZone("zone3744684").setDetail("detail-1335224239").setStatusMessage("statusMessage-958704715").setSelfLink("selfLink1191800166").setTargetLink("targetLink486368555").setLocation("location1901043637").setStartTime("startTime-2129294769").setEndTime("endTime-1607243192").setProgress(OperationProgress.newBuilder().build()).addAllClusterConditions(new ArrayList<StatusCondition>()).addAllNodepoolConditions(new ArrayList<StatusCondition>()).setError(Status.newBuilder().build()).build();
    mockClusterManager.addResponse(expectedResponse);
    String projectId = "projectId-894832108";
    String zone = "zone3744684";
    String clusterId = "clusterId561939637";
    String nodePoolId = "nodePoolId1121557241";
    NodeManagement management = NodeManagement.newBuilder().build();
    Operation actualResponse = client.setNodePoolManagement(projectId, zone, clusterId, nodePoolId, management);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    SetNodePoolManagementRequest actualRequest = ((SetNodePoolManagementRequest) actualRequests.get(0));
    Assert.assertEquals(projectId, actualRequest.getProjectId());
    Assert.assertEquals(zone, actualRequest.getZone());
    Assert.assertEquals(clusterId, actualRequest.getClusterId());
    Assert.assertEquals(nodePoolId, actualRequest.getNodePoolId());
    Assert.assertEquals(management, actualRequest.getManagement());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : AbstractMessage(com.google.protobuf.AbstractMessage) ArrayList(java.util.ArrayList) Operation(com.google.container.v1beta1.Operation) StatusCondition(com.google.container.v1beta1.StatusCondition) NodeManagement(com.google.container.v1beta1.NodeManagement) SetNodePoolManagementRequest(com.google.container.v1beta1.SetNodePoolManagementRequest) Test(org.junit.Test)

Example 100 with Operation

use of org.geosdi.geoplatform.xml.ows.v100.Operation in project java-container by googleapis.

the class ClusterManagerClientTest method updateMasterTest.

@Test
public void updateMasterTest() throws Exception {
    Operation expectedResponse = Operation.newBuilder().setName("name3373707").setZone("zone3744684").setDetail("detail-1335224239").setStatusMessage("statusMessage-958704715").setSelfLink("selfLink1191800166").setTargetLink("targetLink486368555").setLocation("location1901043637").setStartTime("startTime-2129294769").setEndTime("endTime-1607243192").setProgress(OperationProgress.newBuilder().build()).addAllClusterConditions(new ArrayList<StatusCondition>()).addAllNodepoolConditions(new ArrayList<StatusCondition>()).setError(Status.newBuilder().build()).build();
    mockClusterManager.addResponse(expectedResponse);
    String projectId = "projectId-894832108";
    String zone = "zone3744684";
    String clusterId = "clusterId561939637";
    String masterVersion = "masterVersion1167095830";
    Operation actualResponse = client.updateMaster(projectId, zone, clusterId, masterVersion);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    UpdateMasterRequest actualRequest = ((UpdateMasterRequest) actualRequests.get(0));
    Assert.assertEquals(projectId, actualRequest.getProjectId());
    Assert.assertEquals(zone, actualRequest.getZone());
    Assert.assertEquals(clusterId, actualRequest.getClusterId());
    Assert.assertEquals(masterVersion, actualRequest.getMasterVersion());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : AbstractMessage(com.google.protobuf.AbstractMessage) ArrayList(java.util.ArrayList) Operation(com.google.container.v1beta1.Operation) StatusCondition(com.google.container.v1beta1.StatusCondition) UpdateMasterRequest(com.google.container.v1beta1.UpdateMasterRequest) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)79 Test (org.junit.Test)75 AbstractMessage (com.google.protobuf.AbstractMessage)65 Operation (com.google.container.v1.Operation)43 StatusCondition (com.google.container.v1.StatusCondition)40 Operation (com.google.cloud.compute.v1.Operation)31 Operation (com.google.container.v1beta1.Operation)24 StatusCondition (com.google.container.v1beta1.StatusCondition)23 Operation (net.opengis.ows.v_1_0_0.Operation)15 InstancesClient (com.google.cloud.compute.v1.InstancesClient)13 DomainType (net.opengis.ows.v_1_0_0.DomainType)13 AttachedDisk (com.google.cloud.compute.v1.AttachedDisk)8 Instance (com.google.cloud.compute.v1.Instance)8 Operation (org.osate.aadl2.Operation)8 InsertInstanceRequest (com.google.cloud.compute.v1.InsertInstanceRequest)7 InstanceTemplatesClient (com.google.cloud.compute.v1.InstanceTemplatesClient)7 BooleanLiteral (org.osate.aadl2.BooleanLiteral)7 ClassifierValue (org.osate.aadl2.ClassifierValue)7 ContainedNamedElement (org.osate.aadl2.ContainedNamedElement)7 ContainmentPathElement (org.osate.aadl2.ContainmentPathElement)7