Search in sources :

Example 41 with Operation

use of org.osate.aadl2.Operation in project java-container by googleapis.

the class ClusterManagerClientTest method setMasterAuthTest.

@Test
public void setMasterAuthTest() 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);
    SetMasterAuthRequest request = SetMasterAuthRequest.newBuilder().setProjectId("projectId-894832108").setZone("zone3744684").setClusterId("clusterId561939637").setUpdate(MasterAuth.newBuilder().build()).setName("name3373707").build();
    Operation actualResponse = client.setMasterAuth(request);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    SetMasterAuthRequest actualRequest = ((SetMasterAuthRequest) actualRequests.get(0));
    Assert.assertEquals(request.getProjectId(), actualRequest.getProjectId());
    Assert.assertEquals(request.getZone(), actualRequest.getZone());
    Assert.assertEquals(request.getClusterId(), actualRequest.getClusterId());
    Assert.assertEquals(request.getAction(), actualRequest.getAction());
    Assert.assertEquals(request.getUpdate(), actualRequest.getUpdate());
    Assert.assertEquals(request.getName(), actualRequest.getName());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : AbstractMessage(com.google.protobuf.AbstractMessage) ArrayList(java.util.ArrayList) SetMasterAuthRequest(com.google.container.v1.SetMasterAuthRequest) Operation(com.google.container.v1.Operation) StatusCondition(com.google.container.v1.StatusCondition) Test(org.junit.Test)

Example 42 with Operation

use of org.osate.aadl2.Operation in project java-container by googleapis.

the class ClusterManagerClientTest method startIPRotationTest.

@Test
public void startIPRotationTest() 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 name = "name3373707";
    Operation actualResponse = client.startIPRotation(name);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    StartIPRotationRequest actualRequest = ((StartIPRotationRequest) actualRequests.get(0));
    Assert.assertEquals(name, actualRequest.getName());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : AbstractMessage(com.google.protobuf.AbstractMessage) ArrayList(java.util.ArrayList) Operation(com.google.container.v1.Operation) StartIPRotationRequest(com.google.container.v1.StartIPRotationRequest) StatusCondition(com.google.container.v1.StatusCondition) Test(org.junit.Test)

Example 43 with Operation

use of org.osate.aadl2.Operation in project java-container by googleapis.

the class ClusterManagerClientTest method createNodePoolTest.

@Test
public void createNodePoolTest() 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 parent = "parent-995424086";
    NodePool nodePool = NodePool.newBuilder().build();
    Operation actualResponse = client.createNodePool(parent, nodePool);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    CreateNodePoolRequest actualRequest = ((CreateNodePoolRequest) actualRequests.get(0));
    Assert.assertEquals(parent, actualRequest.getParent());
    Assert.assertEquals(nodePool, actualRequest.getNodePool());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : AbstractMessage(com.google.protobuf.AbstractMessage) NodePool(com.google.container.v1.NodePool) ArrayList(java.util.ArrayList) Operation(com.google.container.v1.Operation) StatusCondition(com.google.container.v1.StatusCondition) CreateNodePoolRequest(com.google.container.v1.CreateNodePoolRequest) Test(org.junit.Test)

Example 44 with Operation

use of org.osate.aadl2.Operation in project java-container by googleapis.

the class ClusterManagerClientTest method setAddonsConfigTest.

@Test
public void setAddonsConfigTest() 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 name = "name3373707";
    AddonsConfig addonsConfig = AddonsConfig.newBuilder().build();
    Operation actualResponse = client.setAddonsConfig(name, addonsConfig);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    SetAddonsConfigRequest actualRequest = ((SetAddonsConfigRequest) actualRequests.get(0));
    Assert.assertEquals(name, actualRequest.getName());
    Assert.assertEquals(addonsConfig, actualRequest.getAddonsConfig());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : AbstractMessage(com.google.protobuf.AbstractMessage) ArrayList(java.util.ArrayList) AddonsConfig(com.google.container.v1.AddonsConfig) Operation(com.google.container.v1.Operation) StatusCondition(com.google.container.v1.StatusCondition) SetAddonsConfigRequest(com.google.container.v1.SetAddonsConfigRequest) Test(org.junit.Test)

Example 45 with Operation

use of org.osate.aadl2.Operation in project java-container by googleapis.

the class ClusterManagerClientTest method rollbackNodePoolUpgradeTest.

@Test
public void rollbackNodePoolUpgradeTest() 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 name = "name3373707";
    Operation actualResponse = client.rollbackNodePoolUpgrade(name);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    RollbackNodePoolUpgradeRequest actualRequest = ((RollbackNodePoolUpgradeRequest) actualRequests.get(0));
    Assert.assertEquals(name, actualRequest.getName());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : AbstractMessage(com.google.protobuf.AbstractMessage) ArrayList(java.util.ArrayList) Operation(com.google.container.v1.Operation) RollbackNodePoolUpgradeRequest(com.google.container.v1.RollbackNodePoolUpgradeRequest) StatusCondition(com.google.container.v1.StatusCondition) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)86 Test (org.junit.Test)75 AbstractMessage (com.google.protobuf.AbstractMessage)65 Operation (com.google.cloud.compute.v1.Operation)49 Operation (com.google.container.v1.Operation)43 StatusCondition (com.google.container.v1.StatusCondition)40 Operation (com.google.container.v1beta1.Operation)24 StatusCondition (com.google.container.v1beta1.StatusCondition)23 InstancesClient (com.google.cloud.compute.v1.InstancesClient)20 Operation (com.reprezen.kaizen.oasparser.model3.Operation)16 Path (com.reprezen.kaizen.oasparser.model3.Path)15 Operation (net.opengis.ows.v_1_0_0.Operation)15 Instance (com.google.cloud.compute.v1.Instance)13 Parameter (com.reprezen.kaizen.oasparser.model3.Parameter)13 DomainType (net.opengis.ows.v_1_0_0.DomainType)13 AttachedDisk (com.google.cloud.compute.v1.AttachedDisk)12 AadlPackage (org.osate.aadl2.AadlPackage)12 InsertInstanceRequest (com.google.cloud.compute.v1.InsertInstanceRequest)11 List (java.util.List)9 Optional (java.util.Optional)9