Search in sources :

Example 1 with GetClusterRequest

use of com.google.container.v1beta1.GetClusterRequest in project java-bigtable by googleapis.

the class BaseBigtableInstanceAdminClientTest method getClusterTest.

@Test
public void getClusterTest() throws Exception {
    Cluster expectedResponse = Cluster.newBuilder().setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()).setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()).setServeNodes(-1288838783).setDefaultStorageType(StorageType.forNumber(0)).setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()).build();
    mockBigtableInstanceAdmin.addResponse(expectedResponse);
    ClusterName name = ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]");
    Cluster actualResponse = client.getCluster(name);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockBigtableInstanceAdmin.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    GetClusterRequest actualRequest = ((GetClusterRequest) actualRequests.get(0));
    Assert.assertEquals(name.toString(), actualRequest.getName());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : GetClusterRequest(com.google.bigtable.admin.v2.GetClusterRequest) AbstractMessage(com.google.protobuf.AbstractMessage) Cluster(com.google.bigtable.admin.v2.Cluster) ClusterName(com.google.bigtable.admin.v2.ClusterName) Test(org.junit.Test)

Example 2 with GetClusterRequest

use of com.google.container.v1beta1.GetClusterRequest in project java-container by googleapis.

the class ClusterManagerClientTest method getClusterTest.

@Test
public void getClusterTest() throws Exception {
    Cluster expectedResponse = Cluster.newBuilder().setName("name3373707").setDescription("description-1724546052").setInitialNodeCount(1682564205).setNodeConfig(NodeConfig.newBuilder().build()).setMasterAuth(MasterAuth.newBuilder().build()).setLoggingService("loggingService1098570326").setMonitoringService("monitoringService-1431578291").setNetwork("network1843485230").setClusterIpv4Cidr("clusterIpv4Cidr-277423341").setAddonsConfig(AddonsConfig.newBuilder().build()).setSubnetwork("subnetwork-1302785042").addAllNodePools(new ArrayList<NodePool>()).addAllLocations(new ArrayList<String>()).setEnableKubernetesAlpha(true).putAllResourceLabels(new HashMap<String, String>()).setLabelFingerprint("labelFingerprint379449680").setLegacyAbac(LegacyAbac.newBuilder().build()).setNetworkPolicy(NetworkPolicy.newBuilder().build()).setIpAllocationPolicy(IPAllocationPolicy.newBuilder().build()).setMasterAuthorizedNetworksConfig(MasterAuthorizedNetworksConfig.newBuilder().build()).setMaintenancePolicy(MaintenancePolicy.newBuilder().build()).setBinaryAuthorization(BinaryAuthorization.newBuilder().build()).setPodSecurityPolicyConfig(PodSecurityPolicyConfig.newBuilder().build()).setAutoscaling(ClusterAutoscaling.newBuilder().build()).setNetworkConfig(NetworkConfig.newBuilder().build()).setPrivateCluster(true).setMasterIpv4CidrBlock("masterIpv4CidrBlock42581458").setDefaultMaxPodsConstraint(MaxPodsConstraint.newBuilder().build()).setResourceUsageExportConfig(ResourceUsageExportConfig.newBuilder().build()).setAuthenticatorGroupsConfig(AuthenticatorGroupsConfig.newBuilder().build()).setPrivateClusterConfig(PrivateClusterConfig.newBuilder().build()).setVerticalPodAutoscaling(VerticalPodAutoscaling.newBuilder().build()).setShieldedNodes(ShieldedNodes.newBuilder().build()).setReleaseChannel(ReleaseChannel.newBuilder().build()).setWorkloadIdentityConfig(WorkloadIdentityConfig.newBuilder().build()).setWorkloadCertificates(WorkloadCertificates.newBuilder().build()).setMeshCertificates(MeshCertificates.newBuilder().build()).setClusterTelemetry(ClusterTelemetry.newBuilder().build()).setTpuConfig(TpuConfig.newBuilder().build()).setNotificationConfig(NotificationConfig.newBuilder().build()).setConfidentialNodes(ConfidentialNodes.newBuilder().build()).setIdentityServiceConfig(IdentityServiceConfig.newBuilder().build()).setSelfLink("selfLink1191800166").setZone("zone3744684").setEndpoint("endpoint1741102485").setInitialClusterVersion("initialClusterVersion-1547734558").setCurrentMasterVersion("currentMasterVersion1871927069").setCurrentNodeVersion("currentNodeVersion373921085").setCreateTime("createTime1369213417").setStatusMessage("statusMessage-958704715").setNodeIpv4CidrSize(1181176815).setServicesIpv4Cidr("servicesIpv4Cidr-1785842313").addAllInstanceGroupUrls(new ArrayList<String>()).setCurrentNodeCount(178977560).setExpireTime("expireTime-834724724").setLocation("location1901043637").setEnableTpu(true).setTpuIpv4CidrBlock("tpuIpv4CidrBlock997172251").setDatabaseEncryption(DatabaseEncryption.newBuilder().build()).addAllConditions(new ArrayList<StatusCondition>()).setMaster(Master.newBuilder().build()).setAutopilot(Autopilot.newBuilder().build()).setId("id3355").setNodePoolDefaults(NodePoolDefaults.newBuilder().build()).setLoggingConfig(LoggingConfig.newBuilder().build()).setMonitoringConfig(MonitoringConfig.newBuilder().build()).build();
    mockClusterManager.addResponse(expectedResponse);
    String projectId = "projectId-894832108";
    String zone = "zone3744684";
    String clusterId = "clusterId561939637";
    Cluster actualResponse = client.getCluster(projectId, zone, clusterId);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    GetClusterRequest actualRequest = ((GetClusterRequest) 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 : GetClusterRequest(com.google.container.v1beta1.GetClusterRequest) AbstractMessage(com.google.protobuf.AbstractMessage) ArrayList(java.util.ArrayList) Cluster(com.google.container.v1beta1.Cluster) Test(org.junit.Test)

Example 3 with GetClusterRequest

use of com.google.container.v1beta1.GetClusterRequest in project java-container by googleapis.

the class ClusterManagerClientTest method getClusterTest.

@Test
public void getClusterTest() throws Exception {
    Cluster expectedResponse = Cluster.newBuilder().setName("name3373707").setDescription("description-1724546052").setInitialNodeCount(1682564205).setNodeConfig(NodeConfig.newBuilder().build()).setMasterAuth(MasterAuth.newBuilder().build()).setLoggingService("loggingService1098570326").setMonitoringService("monitoringService-1431578291").setNetwork("network1843485230").setClusterIpv4Cidr("clusterIpv4Cidr-277423341").setAddonsConfig(AddonsConfig.newBuilder().build()).setSubnetwork("subnetwork-1302785042").addAllNodePools(new ArrayList<NodePool>()).addAllLocations(new ArrayList<String>()).setEnableKubernetesAlpha(true).putAllResourceLabels(new HashMap<String, String>()).setLabelFingerprint("labelFingerprint379449680").setLegacyAbac(LegacyAbac.newBuilder().build()).setNetworkPolicy(NetworkPolicy.newBuilder().build()).setIpAllocationPolicy(IPAllocationPolicy.newBuilder().build()).setMasterAuthorizedNetworksConfig(MasterAuthorizedNetworksConfig.newBuilder().build()).setMaintenancePolicy(MaintenancePolicy.newBuilder().build()).setBinaryAuthorization(BinaryAuthorization.newBuilder().build()).setAutoscaling(ClusterAutoscaling.newBuilder().build()).setNetworkConfig(NetworkConfig.newBuilder().build()).setDefaultMaxPodsConstraint(MaxPodsConstraint.newBuilder().build()).setResourceUsageExportConfig(ResourceUsageExportConfig.newBuilder().build()).setAuthenticatorGroupsConfig(AuthenticatorGroupsConfig.newBuilder().build()).setPrivateClusterConfig(PrivateClusterConfig.newBuilder().build()).setDatabaseEncryption(DatabaseEncryption.newBuilder().build()).setVerticalPodAutoscaling(VerticalPodAutoscaling.newBuilder().build()).setShieldedNodes(ShieldedNodes.newBuilder().build()).setReleaseChannel(ReleaseChannel.newBuilder().build()).setWorkloadIdentityConfig(WorkloadIdentityConfig.newBuilder().build()).setMeshCertificates(MeshCertificates.newBuilder().build()).setNotificationConfig(NotificationConfig.newBuilder().build()).setConfidentialNodes(ConfidentialNodes.newBuilder().build()).setSelfLink("selfLink1191800166").setZone("zone3744684").setEndpoint("endpoint1741102485").setInitialClusterVersion("initialClusterVersion-1547734558").setCurrentMasterVersion("currentMasterVersion1871927069").setCurrentNodeVersion("currentNodeVersion373921085").setCreateTime("createTime1369213417").setStatusMessage("statusMessage-958704715").setNodeIpv4CidrSize(1181176815).setServicesIpv4Cidr("servicesIpv4Cidr-1785842313").addAllInstanceGroupUrls(new ArrayList<String>()).setCurrentNodeCount(178977560).setExpireTime("expireTime-834724724").setLocation("location1901043637").setEnableTpu(true).setTpuIpv4CidrBlock("tpuIpv4CidrBlock997172251").addAllConditions(new ArrayList<StatusCondition>()).setAutopilot(Autopilot.newBuilder().build()).setId("id3355").setNodePoolDefaults(NodePoolDefaults.newBuilder().build()).setLoggingConfig(LoggingConfig.newBuilder().build()).setMonitoringConfig(MonitoringConfig.newBuilder().build()).build();
    mockClusterManager.addResponse(expectedResponse);
    String name = "name3373707";
    Cluster actualResponse = client.getCluster(name);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    GetClusterRequest actualRequest = ((GetClusterRequest) actualRequests.get(0));
    Assert.assertEquals(name, actualRequest.getName());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : GetClusterRequest(com.google.container.v1.GetClusterRequest) AbstractMessage(com.google.protobuf.AbstractMessage) ArrayList(java.util.ArrayList) Cluster(com.google.container.v1.Cluster) StatusCondition(com.google.container.v1.StatusCondition) Test(org.junit.Test)

Example 4 with GetClusterRequest

use of com.google.container.v1beta1.GetClusterRequest in project java-container by googleapis.

the class ClusterManagerClientTest method getClusterTest2.

@Test
public void getClusterTest2() throws Exception {
    Cluster expectedResponse = Cluster.newBuilder().setName("name3373707").setDescription("description-1724546052").setInitialNodeCount(1682564205).setNodeConfig(NodeConfig.newBuilder().build()).setMasterAuth(MasterAuth.newBuilder().build()).setLoggingService("loggingService1098570326").setMonitoringService("monitoringService-1431578291").setNetwork("network1843485230").setClusterIpv4Cidr("clusterIpv4Cidr-277423341").setAddonsConfig(AddonsConfig.newBuilder().build()).setSubnetwork("subnetwork-1302785042").addAllNodePools(new ArrayList<NodePool>()).addAllLocations(new ArrayList<String>()).setEnableKubernetesAlpha(true).putAllResourceLabels(new HashMap<String, String>()).setLabelFingerprint("labelFingerprint379449680").setLegacyAbac(LegacyAbac.newBuilder().build()).setNetworkPolicy(NetworkPolicy.newBuilder().build()).setIpAllocationPolicy(IPAllocationPolicy.newBuilder().build()).setMasterAuthorizedNetworksConfig(MasterAuthorizedNetworksConfig.newBuilder().build()).setMaintenancePolicy(MaintenancePolicy.newBuilder().build()).setBinaryAuthorization(BinaryAuthorization.newBuilder().build()).setAutoscaling(ClusterAutoscaling.newBuilder().build()).setNetworkConfig(NetworkConfig.newBuilder().build()).setDefaultMaxPodsConstraint(MaxPodsConstraint.newBuilder().build()).setResourceUsageExportConfig(ResourceUsageExportConfig.newBuilder().build()).setAuthenticatorGroupsConfig(AuthenticatorGroupsConfig.newBuilder().build()).setPrivateClusterConfig(PrivateClusterConfig.newBuilder().build()).setDatabaseEncryption(DatabaseEncryption.newBuilder().build()).setVerticalPodAutoscaling(VerticalPodAutoscaling.newBuilder().build()).setShieldedNodes(ShieldedNodes.newBuilder().build()).setReleaseChannel(ReleaseChannel.newBuilder().build()).setWorkloadIdentityConfig(WorkloadIdentityConfig.newBuilder().build()).setMeshCertificates(MeshCertificates.newBuilder().build()).setNotificationConfig(NotificationConfig.newBuilder().build()).setConfidentialNodes(ConfidentialNodes.newBuilder().build()).setSelfLink("selfLink1191800166").setZone("zone3744684").setEndpoint("endpoint1741102485").setInitialClusterVersion("initialClusterVersion-1547734558").setCurrentMasterVersion("currentMasterVersion1871927069").setCurrentNodeVersion("currentNodeVersion373921085").setCreateTime("createTime1369213417").setStatusMessage("statusMessage-958704715").setNodeIpv4CidrSize(1181176815).setServicesIpv4Cidr("servicesIpv4Cidr-1785842313").addAllInstanceGroupUrls(new ArrayList<String>()).setCurrentNodeCount(178977560).setExpireTime("expireTime-834724724").setLocation("location1901043637").setEnableTpu(true).setTpuIpv4CidrBlock("tpuIpv4CidrBlock997172251").addAllConditions(new ArrayList<StatusCondition>()).setAutopilot(Autopilot.newBuilder().build()).setId("id3355").setNodePoolDefaults(NodePoolDefaults.newBuilder().build()).setLoggingConfig(LoggingConfig.newBuilder().build()).setMonitoringConfig(MonitoringConfig.newBuilder().build()).build();
    mockClusterManager.addResponse(expectedResponse);
    String projectId = "projectId-894832108";
    String zone = "zone3744684";
    String clusterId = "clusterId561939637";
    Cluster actualResponse = client.getCluster(projectId, zone, clusterId);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockClusterManager.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    GetClusterRequest actualRequest = ((GetClusterRequest) 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 : GetClusterRequest(com.google.container.v1.GetClusterRequest) AbstractMessage(com.google.protobuf.AbstractMessage) ArrayList(java.util.ArrayList) Cluster(com.google.container.v1.Cluster) StatusCondition(com.google.container.v1.StatusCondition) Test(org.junit.Test)

Example 5 with GetClusterRequest

use of com.google.container.v1beta1.GetClusterRequest in project java-bigtable by googleapis.

the class BaseBigtableInstanceAdminClientTest method getClusterTest2.

@Test
public void getClusterTest2() throws Exception {
    Cluster expectedResponse = Cluster.newBuilder().setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()).setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()).setServeNodes(-1288838783).setDefaultStorageType(StorageType.forNumber(0)).setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()).build();
    mockBigtableInstanceAdmin.addResponse(expectedResponse);
    String name = "name3373707";
    Cluster actualResponse = client.getCluster(name);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockBigtableInstanceAdmin.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    GetClusterRequest actualRequest = ((GetClusterRequest) actualRequests.get(0));
    Assert.assertEquals(name, actualRequest.getName());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : GetClusterRequest(com.google.bigtable.admin.v2.GetClusterRequest) AbstractMessage(com.google.protobuf.AbstractMessage) Cluster(com.google.bigtable.admin.v2.Cluster) ByteString(com.google.protobuf.ByteString) Test(org.junit.Test)

Aggregations

AbstractMessage (com.google.protobuf.AbstractMessage)5 Test (org.junit.Test)5 ArrayList (java.util.ArrayList)3 Cluster (com.google.bigtable.admin.v2.Cluster)2 GetClusterRequest (com.google.bigtable.admin.v2.GetClusterRequest)2 Cluster (com.google.container.v1.Cluster)2 GetClusterRequest (com.google.container.v1.GetClusterRequest)2 StatusCondition (com.google.container.v1.StatusCondition)2 ClusterName (com.google.bigtable.admin.v2.ClusterName)1 Cluster (com.google.container.v1beta1.Cluster)1 GetClusterRequest (com.google.container.v1beta1.GetClusterRequest)1 ByteString (com.google.protobuf.ByteString)1