Search in sources :

Example 1 with IpMapping

use of com.google.api.services.sqladmin.model.IpMapping in project cloudbreak by hortonworks.

the class GcpDatabaseServerLaunchServiceTest method testLaunchWhenDatabaseNOTAlreadyExistAndNOTSharedProjectIdShouldCreate.

@Test
public void testLaunchWhenDatabaseNOTAlreadyExistAndNOTSharedProjectIdShouldCreate() throws Exception {
    Network network = new Network(new Subnet("10.0.0.0/16"), Map.of("subnetId", "s-1", "availabilityZone", "a"));
    Map<String, Object> map = new HashMap<>();
    map.put("engineVersion", "1");
    map.put("key", "value");
    DatabaseServer databaseServer = DatabaseServer.builder().connectionDriver("driver").serverId("driver").connectorJarUrl("driver").engine(DatabaseEngine.POSTGRESQL).location("location").port(99).storageSize(50L).rootUserName("rootUserName").rootPassword("rootPassword").flavor("flavor").useSslEnforcement(true).params(map).build();
    AuthenticatedContext authenticatedContext = mock(AuthenticatedContext.class);
    DatabaseStack databaseStack = mock(DatabaseStack.class);
    PersistenceNotifier persistenceNotifier = mock(PersistenceNotifier.class);
    CloudCredential cloudCredential = mock(CloudCredential.class);
    SQLAdmin sqlAdmin = mock(SQLAdmin.class);
    Compute compute = mock(Compute.class);
    DatabaseInstance databaseInstance = mock(DatabaseInstance.class);
    Compute.Subnetworks subnetworks = mock(Compute.Subnetworks.class);
    Compute.Subnetworks.Get subnetworksGet = mock(Compute.Subnetworks.Get.class);
    SQLAdmin.Users users = mock(SQLAdmin.Users.class);
    SQLAdmin.Users.Insert usersInsert = mock(SQLAdmin.Users.Insert.class);
    SQLAdmin.Instances.Get instancesGet = mock(SQLAdmin.Instances.Get.class);
    SQLAdmin.Instances sqlAdminInstances = mock(SQLAdmin.Instances.class);
    SQLAdmin.Instances.List sqlAdminInstancesList = mock(SQLAdmin.Instances.List.class);
    InstancesListResponse instancesListResponse = mock(InstancesListResponse.class);
    Operation operation = mock(Operation.class);
    SQLAdmin.Instances.Insert sqlAdminInstancesInsert = mock(SQLAdmin.Instances.Insert.class);
    IpMapping ipMapping = new IpMapping();
    ipMapping.setIpAddress("10.0.0.0");
    ipMapping.setType("PRIVATE");
    when(authenticatedContext.getCloudCredential()).thenReturn(cloudCredential);
    when(cloudCredential.getName()).thenReturn("credential");
    when(databaseStack.getDatabaseServer()).thenReturn(databaseServer);
    when(databaseStack.getNetwork()).thenReturn(network);
    when(gcpLabelUtil.createLabelsFromTagsMap(anyMap())).thenReturn(new HashMap<>());
    when(gcpSQLAdminFactory.buildSQLAdmin(any(CloudCredential.class), anyString())).thenReturn(sqlAdmin);
    when(gcpComputeFactory.buildCompute(any(CloudCredential.class))).thenReturn(compute);
    when(compute.subnetworks()).thenReturn(subnetworks);
    when(subnetworks.get(anyString(), anyString(), anyString())).thenReturn(subnetworksGet);
    when(subnetworksGet.execute()).thenReturn(new Subnetwork());
    when(gcpStackUtil.getProjectId(any(CloudCredential.class))).thenReturn("project-id");
    when(sqlAdmin.instances()).thenReturn(sqlAdminInstances);
    when(sqlAdminInstances.list(anyString())).thenReturn(sqlAdminInstancesList);
    when(sqlAdminInstancesList.execute()).thenReturn(instancesListResponse);
    when(instancesListResponse.getItems()).thenReturn(List.of());
    when(databaseInstance.getName()).thenReturn("name");
    when(sqlAdminInstances.get(anyString(), anyString())).thenReturn(instancesGet);
    when(instancesGet.execute()).thenReturn(databaseInstance);
    when(sqlAdminInstances.insert(anyString(), databaseInstanceArgumentCaptor.capture())).thenReturn(sqlAdminInstancesInsert);
    when(sqlAdminInstancesInsert.setPrettyPrint(anyBoolean())).thenReturn(sqlAdminInstancesInsert);
    when(sqlAdminInstancesInsert.execute()).thenReturn(operation);
    when(databaseInstance.getIpAddresses()).thenReturn(List.of(ipMapping));
    doNothing().when(databasePollerService).launchDatabasePoller(any(AuthenticatedContext.class), anyList());
    when(sqlAdmin.users()).thenReturn(users);
    when(users.insert(anyString(), anyString(), any(User.class))).thenReturn(usersInsert);
    when(usersInsert.execute()).thenReturn(operation);
    when(authenticatedContext.getCloudContext()).thenReturn(cloudContext);
    when(cloudContext.getLocation()).thenReturn(location(region("region"), availabilityZone("az1")));
    List<CloudResource> launch = underTest.launch(authenticatedContext, databaseStack, persistenceNotifier);
    Assert.assertEquals("value", databaseInstanceArgumentCaptor.getValue().getDiskEncryptionConfiguration().getKmsKeyName());
    Assert.assertEquals(1, launch.size());
}
Also used : User(com.google.api.services.sqladmin.model.User) HashMap(java.util.HashMap) DatabaseStack(com.sequenceiq.cloudbreak.cloud.model.DatabaseStack) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) AuthenticatedContext(com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext) Operation(com.google.api.services.sqladmin.model.Operation) SQLAdmin(com.google.api.services.sqladmin.SQLAdmin) DatabaseInstance(com.google.api.services.sqladmin.model.DatabaseInstance) InstancesListResponse(com.google.api.services.sqladmin.model.InstancesListResponse) Network(com.sequenceiq.cloudbreak.cloud.model.Network) PersistenceNotifier(com.sequenceiq.cloudbreak.cloud.notification.PersistenceNotifier) DatabaseServer(com.sequenceiq.cloudbreak.cloud.model.DatabaseServer) Subnetwork(com.google.api.services.compute.model.Subnetwork) CloudCredential(com.sequenceiq.cloudbreak.cloud.model.CloudCredential) IpMapping(com.google.api.services.sqladmin.model.IpMapping) Compute(com.google.api.services.compute.Compute) CloudResource(com.sequenceiq.cloudbreak.cloud.model.CloudResource) Subnet(com.sequenceiq.cloudbreak.cloud.model.Subnet) Test(org.junit.jupiter.api.Test)

Example 2 with IpMapping

use of com.google.api.services.sqladmin.model.IpMapping in project cloudbreak by hortonworks.

the class GcpDatabaseServerLaunchServiceTest method testGetRdsHostName.

@Test
public void testGetRdsHostName() {
    DatabaseInstance databaseInstance = mock(DatabaseInstance.class);
    IpMapping ipMapping = new IpMapping();
    ipMapping.setIpAddress("10.0.0.0");
    ipMapping.setType("PRIVATE");
    when(databaseInstance.getIpAddresses()).thenReturn(List.of(ipMapping));
    CloudResource rdsHostName = underTest.getRdsHostName(databaseInstance, new CloudResource.Builder(), "id-1", "az1");
    Assert.assertEquals(ResourceType.RDS_HOSTNAME, rdsHostName.getType());
    Assert.assertEquals("10.0.0.0", rdsHostName.getName());
}
Also used : CloudResource(com.sequenceiq.cloudbreak.cloud.model.CloudResource) IpMapping(com.google.api.services.sqladmin.model.IpMapping) DatabaseInstance(com.google.api.services.sqladmin.model.DatabaseInstance) Test(org.junit.jupiter.api.Test)

Example 3 with IpMapping

use of com.google.api.services.sqladmin.model.IpMapping in project cloudbreak by hortonworks.

the class GcpDatabaseServerLaunchServiceTest method testLaunchWhenDatabaseNOTAlreadyExistAndListThrowExceptionShouldThrowGcpResourceException.

@Test
public void testLaunchWhenDatabaseNOTAlreadyExistAndListThrowExceptionShouldThrowGcpResourceException() throws Exception {
    Map<String, Object> map = new HashMap<>();
    map.put("engineVersion", "1");
    DatabaseServer databaseServer = DatabaseServer.builder().connectionDriver("driver").serverId("driver").connectorJarUrl("driver").engine(DatabaseEngine.POSTGRESQL).location("location").port(99).storageSize(50L).rootUserName("rootUserName").rootPassword("rootPassword").flavor("flavor").useSslEnforcement(true).params(map).build();
    AuthenticatedContext authenticatedContext = mock(AuthenticatedContext.class);
    DatabaseStack databaseStack = mock(DatabaseStack.class);
    PersistenceNotifier persistenceNotifier = mock(PersistenceNotifier.class);
    CloudCredential cloudCredential = mock(CloudCredential.class);
    SQLAdmin sqlAdmin = mock(SQLAdmin.class);
    Compute compute = mock(Compute.class);
    SQLAdmin.Instances sqlAdminInstances = mock(SQLAdmin.Instances.class);
    SQLAdmin.Instances.List sqlAdminInstancesList = mock(SQLAdmin.Instances.List.class);
    IpMapping ipMapping = new IpMapping();
    ipMapping.setIpAddress("10.0.0.0");
    ipMapping.setType("PRIVATE");
    GoogleJsonResponseException googleJsonResponseException = mock(GoogleJsonResponseException.class);
    GoogleJsonError googleJsonError = mock(GoogleJsonError.class);
    when(googleJsonResponseException.getDetails()).thenReturn(googleJsonError);
    when(googleJsonError.getMessage()).thenReturn("error");
    when(authenticatedContext.getCloudCredential()).thenReturn(cloudCredential);
    when(cloudCredential.getName()).thenReturn("credential");
    when(databaseStack.getDatabaseServer()).thenReturn(databaseServer);
    when(gcpSQLAdminFactory.buildSQLAdmin(any(CloudCredential.class), anyString())).thenReturn(sqlAdmin);
    when(gcpComputeFactory.buildCompute(any(CloudCredential.class))).thenReturn(compute);
    when(gcpStackUtil.getProjectId(any(CloudCredential.class))).thenReturn("project-id");
    when(authenticatedContext.getCloudContext()).thenReturn(cloudContext);
    when(cloudContext.getLocation()).thenReturn(location(region("region"), availabilityZone("az1")));
    when(sqlAdmin.instances()).thenReturn(sqlAdminInstances);
    when(sqlAdminInstances.list(anyString())).thenReturn(sqlAdminInstancesList);
    when(sqlAdminInstancesList.execute()).thenThrow(googleJsonResponseException);
    GcpResourceException gcpResourceException = assertThrows(GcpResourceException.class, () -> underTest.launch(authenticatedContext, databaseStack, persistenceNotifier));
    Assert.assertEquals("error: [ resourceType: GCP_DATABASE,  resourceName: driver ]", gcpResourceException.getMessage());
}
Also used : HashMap(java.util.HashMap) CloudCredential(com.sequenceiq.cloudbreak.cloud.model.CloudCredential) DatabaseStack(com.sequenceiq.cloudbreak.cloud.model.DatabaseStack) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) AuthenticatedContext(com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext) SQLAdmin(com.google.api.services.sqladmin.SQLAdmin) IpMapping(com.google.api.services.sqladmin.model.IpMapping) GoogleJsonResponseException(com.google.api.client.googleapis.json.GoogleJsonResponseException) PersistenceNotifier(com.sequenceiq.cloudbreak.cloud.notification.PersistenceNotifier) Compute(com.google.api.services.compute.Compute) GcpResourceException(com.sequenceiq.cloudbreak.cloud.gcp.GcpResourceException) DatabaseServer(com.sequenceiq.cloudbreak.cloud.model.DatabaseServer) GoogleJsonError(com.google.api.client.googleapis.json.GoogleJsonError) Test(org.junit.jupiter.api.Test)

Example 4 with IpMapping

use of com.google.api.services.sqladmin.model.IpMapping in project cloudbreak by hortonworks.

the class GcpDatabaseServerLaunchServiceTest method testLaunchWhenDatabaseNOTAlreadyExistAndUserCreateThrowExceptionShouldThrowGcpResourceException.

@Test
public void testLaunchWhenDatabaseNOTAlreadyExistAndUserCreateThrowExceptionShouldThrowGcpResourceException() throws Exception {
    Network network = new Network(new Subnet("10.0.0.0/16"), Map.of("subnetId", "s-1", "availabilityZone", "a"));
    Map<String, Object> map = new HashMap<>();
    map.put("engineVersion", "1");
    DatabaseServer databaseServer = DatabaseServer.builder().connectionDriver("driver").serverId("driver").connectorJarUrl("driver").engine(DatabaseEngine.POSTGRESQL).location("location").port(99).storageSize(50L).rootUserName("rootUserName").rootPassword("rootPassword").flavor("flavor").useSslEnforcement(true).params(map).build();
    AuthenticatedContext authenticatedContext = mock(AuthenticatedContext.class);
    DatabaseStack databaseStack = mock(DatabaseStack.class);
    PersistenceNotifier persistenceNotifier = mock(PersistenceNotifier.class);
    CloudCredential cloudCredential = mock(CloudCredential.class);
    SQLAdmin sqlAdmin = mock(SQLAdmin.class);
    Compute compute = mock(Compute.class);
    DatabaseInstance databaseInstance = mock(DatabaseInstance.class);
    Compute.Subnetworks subnetworks = mock(Compute.Subnetworks.class);
    Compute.Subnetworks.Get subnetworksGet = mock(Compute.Subnetworks.Get.class);
    SQLAdmin.Users users = mock(SQLAdmin.Users.class);
    SQLAdmin.Users.Insert usersInsert = mock(SQLAdmin.Users.Insert.class);
    SQLAdmin.Instances.Get instancesGet = mock(SQLAdmin.Instances.Get.class);
    SQLAdmin.Instances sqlAdminInstances = mock(SQLAdmin.Instances.class);
    SQLAdmin.Instances.List sqlAdminInstancesList = mock(SQLAdmin.Instances.List.class);
    InstancesListResponse instancesListResponse = mock(InstancesListResponse.class);
    Operation operation = mock(Operation.class);
    SQLAdmin.Instances.Insert sqlAdminInstancesInsert = mock(SQLAdmin.Instances.Insert.class);
    IpMapping ipMapping = new IpMapping();
    ipMapping.setIpAddress("10.0.0.0");
    ipMapping.setType("PRIVATE");
    GoogleJsonResponseException googleJsonResponseException = mock(GoogleJsonResponseException.class);
    GoogleJsonError googleJsonError = mock(GoogleJsonError.class);
    when(googleJsonResponseException.getDetails()).thenReturn(googleJsonError);
    when(googleJsonError.getMessage()).thenReturn("error");
    when(authenticatedContext.getCloudCredential()).thenReturn(cloudCredential);
    when(cloudCredential.getName()).thenReturn("credential");
    when(databaseStack.getDatabaseServer()).thenReturn(databaseServer);
    when(databaseStack.getNetwork()).thenReturn(network);
    when(gcpLabelUtil.createLabelsFromTagsMap(anyMap())).thenReturn(new HashMap<>());
    when(gcpSQLAdminFactory.buildSQLAdmin(any(CloudCredential.class), anyString())).thenReturn(sqlAdmin);
    when(gcpComputeFactory.buildCompute(any(CloudCredential.class))).thenReturn(compute);
    when(compute.subnetworks()).thenReturn(subnetworks);
    when(subnetworks.get(anyString(), anyString(), anyString())).thenReturn(subnetworksGet);
    when(subnetworksGet.execute()).thenReturn(new Subnetwork());
    when(gcpStackUtil.getProjectId(any(CloudCredential.class))).thenReturn("project-id");
    when(sqlAdmin.instances()).thenReturn(sqlAdminInstances);
    when(sqlAdminInstances.list(anyString())).thenReturn(sqlAdminInstancesList);
    when(sqlAdminInstancesList.execute()).thenReturn(instancesListResponse);
    when(instancesListResponse.getItems()).thenReturn(List.of());
    when(databaseInstance.getName()).thenReturn("name");
    when(sqlAdminInstances.get(anyString(), anyString())).thenReturn(instancesGet);
    when(instancesGet.execute()).thenReturn(databaseInstance);
    when(sqlAdminInstances.insert(anyString(), any(DatabaseInstance.class))).thenReturn(sqlAdminInstancesInsert);
    when(sqlAdminInstancesInsert.setPrettyPrint(anyBoolean())).thenReturn(sqlAdminInstancesInsert);
    when(sqlAdminInstancesInsert.execute()).thenReturn(operation);
    when(databaseInstance.getIpAddresses()).thenReturn(List.of(ipMapping));
    doNothing().when(databasePollerService).launchDatabasePoller(any(AuthenticatedContext.class), anyList());
    when(sqlAdmin.users()).thenReturn(users);
    when(users.insert(anyString(), anyString(), any(User.class))).thenReturn(usersInsert);
    when(usersInsert.execute()).thenThrow(googleJsonResponseException);
    when(authenticatedContext.getCloudContext()).thenReturn(cloudContext);
    when(cloudContext.getLocation()).thenReturn(location(region("region"), availabilityZone("az1")));
    GcpResourceException gcpResourceException = assertThrows(GcpResourceException.class, () -> underTest.launch(authenticatedContext, databaseStack, persistenceNotifier));
    Assert.assertEquals("error: [ resourceType: GCP_DATABASE,  resourceName: driver ]", gcpResourceException.getMessage());
}
Also used : User(com.google.api.services.sqladmin.model.User) HashMap(java.util.HashMap) DatabaseStack(com.sequenceiq.cloudbreak.cloud.model.DatabaseStack) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) AuthenticatedContext(com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext) Operation(com.google.api.services.sqladmin.model.Operation) SQLAdmin(com.google.api.services.sqladmin.SQLAdmin) DatabaseInstance(com.google.api.services.sqladmin.model.DatabaseInstance) InstancesListResponse(com.google.api.services.sqladmin.model.InstancesListResponse) Network(com.sequenceiq.cloudbreak.cloud.model.Network) PersistenceNotifier(com.sequenceiq.cloudbreak.cloud.notification.PersistenceNotifier) DatabaseServer(com.sequenceiq.cloudbreak.cloud.model.DatabaseServer) GoogleJsonError(com.google.api.client.googleapis.json.GoogleJsonError) Subnetwork(com.google.api.services.compute.model.Subnetwork) CloudCredential(com.sequenceiq.cloudbreak.cloud.model.CloudCredential) IpMapping(com.google.api.services.sqladmin.model.IpMapping) GoogleJsonResponseException(com.google.api.client.googleapis.json.GoogleJsonResponseException) Compute(com.google.api.services.compute.Compute) GcpResourceException(com.sequenceiq.cloudbreak.cloud.gcp.GcpResourceException) Subnet(com.sequenceiq.cloudbreak.cloud.model.Subnet) Test(org.junit.jupiter.api.Test)

Example 5 with IpMapping

use of com.google.api.services.sqladmin.model.IpMapping in project cloudbreak by hortonworks.

the class GcpDatabaseServerLaunchServiceTest method testLaunchWhenDatabaseNOTAlreadyExistAndSharedProjectIdShouldCreate.

@Test
public void testLaunchWhenDatabaseNOTAlreadyExistAndSharedProjectIdShouldCreate() throws Exception {
    Network network = new Network(new Subnet("10.0.0.0/16"), Map.of("subnetId", "s-1", "availabilityZone", "a", "sharedProjectId", "sp1"));
    Map<String, Object> map = new HashMap<>();
    map.put("engineVersion", "1");
    DatabaseServer databaseServer = DatabaseServer.builder().connectionDriver("driver").serverId("driver").connectorJarUrl("driver").engine(DatabaseEngine.POSTGRESQL).location("location").port(99).storageSize(50L).rootUserName("rootUserName").rootPassword("rootPassword").flavor("flavor").useSslEnforcement(true).params(map).build();
    AuthenticatedContext authenticatedContext = mock(AuthenticatedContext.class);
    DatabaseStack databaseStack = mock(DatabaseStack.class);
    PersistenceNotifier persistenceNotifier = mock(PersistenceNotifier.class);
    CloudCredential cloudCredential = mock(CloudCredential.class);
    SQLAdmin sqlAdmin = mock(SQLAdmin.class);
    Compute compute = mock(Compute.class);
    DatabaseInstance databaseInstance = mock(DatabaseInstance.class);
    Compute.Subnetworks subnetworks = mock(Compute.Subnetworks.class);
    Compute.Subnetworks.Get subnetworksGet = mock(Compute.Subnetworks.Get.class);
    SQLAdmin.Users users = mock(SQLAdmin.Users.class);
    SQLAdmin.Users.Insert usersInsert = mock(SQLAdmin.Users.Insert.class);
    SQLAdmin.Instances.Get instancesGet = mock(SQLAdmin.Instances.Get.class);
    SQLAdmin.Instances sqlAdminInstances = mock(SQLAdmin.Instances.class);
    SQLAdmin.Instances.List sqlAdminInstancesList = mock(SQLAdmin.Instances.List.class);
    InstancesListResponse instancesListResponse = mock(InstancesListResponse.class);
    Operation operation = mock(Operation.class);
    SQLAdmin.Instances.Insert sqlAdminInstancesInsert = mock(SQLAdmin.Instances.Insert.class);
    IpMapping ipMapping = new IpMapping();
    ipMapping.setIpAddress("10.0.0.0");
    ipMapping.setType("PRIVATE");
    when(authenticatedContext.getCloudCredential()).thenReturn(cloudCredential);
    when(cloudCredential.getName()).thenReturn("credential");
    when(databaseStack.getDatabaseServer()).thenReturn(databaseServer);
    when(databaseStack.getNetwork()).thenReturn(network);
    when(gcpLabelUtil.createLabelsFromTagsMap(anyMap())).thenReturn(new HashMap<>());
    when(gcpSQLAdminFactory.buildSQLAdmin(any(CloudCredential.class), anyString())).thenReturn(sqlAdmin);
    when(gcpComputeFactory.buildCompute(any(CloudCredential.class))).thenReturn(compute);
    when(compute.subnetworks()).thenReturn(subnetworks);
    when(subnetworks.get(anyString(), anyString(), anyString())).thenReturn(subnetworksGet);
    when(subnetworksGet.execute()).thenReturn(new Subnetwork());
    when(gcpStackUtil.getProjectId(any(CloudCredential.class))).thenReturn("project-id");
    when(sqlAdmin.instances()).thenReturn(sqlAdminInstances);
    when(sqlAdminInstances.list(anyString())).thenReturn(sqlAdminInstancesList);
    when(sqlAdminInstancesList.execute()).thenReturn(instancesListResponse);
    when(instancesListResponse.getItems()).thenReturn(List.of());
    when(databaseInstance.getName()).thenReturn("name");
    when(sqlAdminInstances.get(anyString(), anyString())).thenReturn(instancesGet);
    when(instancesGet.execute()).thenReturn(databaseInstance);
    when(sqlAdminInstances.insert(anyString(), databaseInstanceArgumentCaptor.capture())).thenReturn(sqlAdminInstancesInsert);
    when(sqlAdminInstancesInsert.setPrettyPrint(anyBoolean())).thenReturn(sqlAdminInstancesInsert);
    when(sqlAdminInstancesInsert.execute()).thenReturn(operation);
    when(databaseInstance.getIpAddresses()).thenReturn(List.of(ipMapping));
    doNothing().when(databasePollerService).launchDatabasePoller(any(AuthenticatedContext.class), anyList());
    when(sqlAdmin.users()).thenReturn(users);
    when(users.insert(anyString(), anyString(), any(User.class))).thenReturn(usersInsert);
    when(usersInsert.execute()).thenReturn(operation);
    when(authenticatedContext.getCloudContext()).thenReturn(cloudContext);
    when(cloudContext.getLocation()).thenReturn(location(region("region"), availabilityZone("az1")));
    List<CloudResource> launch = underTest.launch(authenticatedContext, databaseStack, persistenceNotifier);
    assertNull(databaseInstanceArgumentCaptor.getValue().getDiskEncryptionConfiguration());
    Assert.assertEquals(1, launch.size());
}
Also used : User(com.google.api.services.sqladmin.model.User) HashMap(java.util.HashMap) DatabaseStack(com.sequenceiq.cloudbreak.cloud.model.DatabaseStack) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) AuthenticatedContext(com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext) Operation(com.google.api.services.sqladmin.model.Operation) SQLAdmin(com.google.api.services.sqladmin.SQLAdmin) DatabaseInstance(com.google.api.services.sqladmin.model.DatabaseInstance) InstancesListResponse(com.google.api.services.sqladmin.model.InstancesListResponse) Network(com.sequenceiq.cloudbreak.cloud.model.Network) PersistenceNotifier(com.sequenceiq.cloudbreak.cloud.notification.PersistenceNotifier) DatabaseServer(com.sequenceiq.cloudbreak.cloud.model.DatabaseServer) Subnetwork(com.google.api.services.compute.model.Subnetwork) CloudCredential(com.sequenceiq.cloudbreak.cloud.model.CloudCredential) IpMapping(com.google.api.services.sqladmin.model.IpMapping) Compute(com.google.api.services.compute.Compute) CloudResource(com.sequenceiq.cloudbreak.cloud.model.CloudResource) Subnet(com.sequenceiq.cloudbreak.cloud.model.Subnet) Test(org.junit.jupiter.api.Test)

Aggregations

IpMapping (com.google.api.services.sqladmin.model.IpMapping)5 Test (org.junit.jupiter.api.Test)5 Compute (com.google.api.services.compute.Compute)4 SQLAdmin (com.google.api.services.sqladmin.SQLAdmin)4 DatabaseInstance (com.google.api.services.sqladmin.model.DatabaseInstance)4 AuthenticatedContext (com.sequenceiq.cloudbreak.cloud.context.AuthenticatedContext)4 CloudCredential (com.sequenceiq.cloudbreak.cloud.model.CloudCredential)4 DatabaseServer (com.sequenceiq.cloudbreak.cloud.model.DatabaseServer)4 DatabaseStack (com.sequenceiq.cloudbreak.cloud.model.DatabaseStack)4 PersistenceNotifier (com.sequenceiq.cloudbreak.cloud.notification.PersistenceNotifier)4 HashMap (java.util.HashMap)4 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)4 Subnetwork (com.google.api.services.compute.model.Subnetwork)3 InstancesListResponse (com.google.api.services.sqladmin.model.InstancesListResponse)3 Operation (com.google.api.services.sqladmin.model.Operation)3 User (com.google.api.services.sqladmin.model.User)3 CloudResource (com.sequenceiq.cloudbreak.cloud.model.CloudResource)3 Network (com.sequenceiq.cloudbreak.cloud.model.Network)3 Subnet (com.sequenceiq.cloudbreak.cloud.model.Subnet)3 GoogleJsonError (com.google.api.client.googleapis.json.GoogleJsonError)2