use of com.sequenceiq.sdx.api.model.SdxDatabaseRequest in project cloudbreak by hortonworks.
the class SdxExternalDatabaseConfigurerTest method whenPlatformIsAzureWithoutRuntimeVerionSetAndNoDbRequested.
@Test
public void whenPlatformIsAzureWithoutRuntimeVerionSetAndNoDbRequested() {
CloudPlatform cloudPlatform = CloudPlatform.AZURE;
SdxDatabaseRequest dbRequest = new SdxDatabaseRequest();
dbRequest.setAvailabilityType(SdxDatabaseAvailabilityType.NONE);
SdxCluster sdxCluster = new SdxCluster();
sdxCluster.setClusterName("clusterName");
underTest.configure(cloudPlatform, dbRequest, sdxCluster);
assertEquals(false, sdxCluster.isCreateDatabase());
assertEquals(SdxDatabaseAvailabilityType.NONE, sdxCluster.getDatabaseAvailabilityType());
}
use of com.sequenceiq.sdx.api.model.SdxDatabaseRequest in project cloudbreak by hortonworks.
the class SdxExternalDatabaseConfigurerTest method whenPlatformIsYarnShouldNotAllowDatabase.
@Test
public void whenPlatformIsYarnShouldNotAllowDatabase() {
CloudPlatform cloudPlatform = CloudPlatform.YARN;
when(platformConfig.isExternalDatabaseSupportedOrExperimental(cloudPlatform)).thenReturn(false);
SdxDatabaseRequest dbRequest = new SdxDatabaseRequest();
dbRequest.setAvailabilityType(SdxDatabaseAvailabilityType.HA);
SdxCluster sdxCluster = new SdxCluster();
Assertions.assertThrows(BadRequestException.class, () -> underTest.configure(cloudPlatform, dbRequest, sdxCluster));
assertEquals(true, sdxCluster.isCreateDatabase());
assertEquals(SdxDatabaseAvailabilityType.HA, sdxCluster.getDatabaseAvailabilityType());
}
use of com.sequenceiq.sdx.api.model.SdxDatabaseRequest in project cloudbreak by hortonworks.
the class SdxExternalDatabaseConfigurerTest method whenPlatformIsAzureWithNewerSupportedVersion.
@Test
public void whenPlatformIsAzureWithNewerSupportedVersion() {
CloudPlatform cloudPlatform = CloudPlatform.AZURE;
when(platformConfig.isExternalDatabaseSupportedFor(cloudPlatform)).thenReturn(true);
when(platformConfig.isExternalDatabaseSupportedOrExperimental(CloudPlatform.AZURE)).thenReturn(true);
SdxDatabaseRequest dbRequest = new SdxDatabaseRequest();
SdxCluster sdxCluster = new SdxCluster();
sdxCluster.setClusterName("clusterName");
sdxCluster.setRuntime("7.2.0");
underTest.configure(cloudPlatform, dbRequest, sdxCluster);
assertEquals(true, sdxCluster.isCreateDatabase());
assertEquals(SdxDatabaseAvailabilityType.HA, sdxCluster.getDatabaseAvailabilityType());
}
use of com.sequenceiq.sdx.api.model.SdxDatabaseRequest in project cloudbreak by hortonworks.
the class SdxExternalDatabaseConfigurerTest method whenPlatformIsAzureWithNotSupportedRuntime.
@Test
public void whenPlatformIsAzureWithNotSupportedRuntime() {
CloudPlatform cloudPlatform = CloudPlatform.AZURE;
when(platformConfig.isExternalDatabaseSupportedFor(cloudPlatform)).thenReturn(true);
SdxDatabaseRequest dbRequest = new SdxDatabaseRequest();
SdxCluster sdxCluster = new SdxCluster();
sdxCluster.setClusterName("clusterName");
sdxCluster.setRuntime("7.0.2");
underTest.configure(cloudPlatform, dbRequest, sdxCluster);
assertEquals(false, sdxCluster.isCreateDatabase());
assertEquals(SdxDatabaseAvailabilityType.NONE, sdxCluster.getDatabaseAvailabilityType());
}
use of com.sequenceiq.sdx.api.model.SdxDatabaseRequest in project cloudbreak by hortonworks.
the class SdxExternalDatabaseConfigurerTest method whenPlatformIsAzureWithMinSupportedVersion.
@Test
public void whenPlatformIsAzureWithMinSupportedVersion() {
CloudPlatform cloudPlatform = CloudPlatform.AZURE;
when(platformConfig.isExternalDatabaseSupportedFor(cloudPlatform)).thenReturn(true);
when(platformConfig.isExternalDatabaseSupportedOrExperimental(CloudPlatform.AZURE)).thenReturn(true);
SdxDatabaseRequest dbRequest = new SdxDatabaseRequest();
SdxCluster sdxCluster = new SdxCluster();
sdxCluster.setClusterName("clusterName");
sdxCluster.setRuntime("7.1.0");
underTest.configure(cloudPlatform, dbRequest, sdxCluster);
assertEquals(true, sdxCluster.isCreateDatabase());
assertEquals(SdxDatabaseAvailabilityType.HA, sdxCluster.getDatabaseAvailabilityType());
}
Aggregations