use of org.osate.aadl2.Operation in project java-container by googleapis.
the class ClusterManagerClientTest method setMaintenancePolicyTest.
@Test
public void setMaintenancePolicyTest() 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";
MaintenancePolicy maintenancePolicy = MaintenancePolicy.newBuilder().build();
Operation actualResponse = client.setMaintenancePolicy(projectId, zone, clusterId, maintenancePolicy);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
Assert.assertEquals(1, actualRequests.size());
SetMaintenancePolicyRequest actualRequest = ((SetMaintenancePolicyRequest) actualRequests.get(0));
Assert.assertEquals(projectId, actualRequest.getProjectId());
Assert.assertEquals(zone, actualRequest.getZone());
Assert.assertEquals(clusterId, actualRequest.getClusterId());
Assert.assertEquals(maintenancePolicy, actualRequest.getMaintenancePolicy());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of org.osate.aadl2.Operation 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 org.osate.aadl2.Operation in project java-container by googleapis.
the class ClusterManagerClientTest method deleteNodePoolTest.
@Test
public void deleteNodePoolTest() 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";
Operation actualResponse = client.deleteNodePool(projectId, zone, clusterId, nodePoolId);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteNodePoolRequest actualRequest = ((DeleteNodePoolRequest) actualRequests.get(0));
Assert.assertEquals(projectId, actualRequest.getProjectId());
Assert.assertEquals(zone, actualRequest.getZone());
Assert.assertEquals(clusterId, actualRequest.getClusterId());
Assert.assertEquals(nodePoolId, actualRequest.getNodePoolId());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
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 projectId = "projectId-894832108";
String zone = "zone3744684";
String clusterId = "clusterId561939637";
NodePool nodePool = NodePool.newBuilder().build();
Operation actualResponse = client.createNodePool(projectId, zone, clusterId, nodePool);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
Assert.assertEquals(1, actualRequests.size());
CreateNodePoolRequest actualRequest = ((CreateNodePoolRequest) actualRequests.get(0));
Assert.assertEquals(projectId, actualRequest.getProjectId());
Assert.assertEquals(zone, actualRequest.getZone());
Assert.assertEquals(clusterId, actualRequest.getClusterId());
Assert.assertEquals(nodePool, actualRequest.getNodePool());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of org.osate.aadl2.Operation in project geo-platform by geosdi.
the class CatalogCapabilitiesTest method testGetCapabilitiesWithConnector.
@Test
public void testGetCapabilitiesWithConnector() throws Exception {
URL url = new URL("http://catalog.geosdi.org/geonetwork/srv/eng/csw");
GPCatalogConnectorStore serverConnector = newConnector().withServerUrl(url).build();
CatalogGetCapabilitiesRequest<CapabilitiesType> request = serverConnector.createGetCapabilitiesRequest();
CapabilitiesType response = request.getResponse();
logger.info("CSW GET_CAPABILITIES VERSION @@@@@@@@@@@@@@@@@@@@@@@ {}", response.getVersion());
List<Operation> operationList = response.getOperationsMetadata().getOperation();
for (Operation operation : operationList) {
String operationName = operation.getName();
if ("GetRecordById".equals(operationName)) {
List<DomainType> parameterList = operation.getParameter();
for (DomainType parameter : parameterList) {
String parameterName = parameter.getName();
if ("outputSchema".equals(parameterName)) {
List<String> valueList = parameter.getValue();
logger.info("########################### outputSchema\n");
for (String value : valueList) {
logger.info("*** {}", value);
}
}
}
}
}
}
Aggregations