Search in sources :

Example 16 with SdxDatabaseRequest

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());
}
Also used : CloudPlatform(com.sequenceiq.cloudbreak.common.mappable.CloudPlatform) SdxCluster(com.sequenceiq.datalake.entity.SdxCluster) SdxDatabaseRequest(com.sequenceiq.sdx.api.model.SdxDatabaseRequest) Test(org.junit.jupiter.api.Test)

Example 17 with SdxDatabaseRequest

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());
}
Also used : CloudPlatform(com.sequenceiq.cloudbreak.common.mappable.CloudPlatform) SdxCluster(com.sequenceiq.datalake.entity.SdxCluster) SdxDatabaseRequest(com.sequenceiq.sdx.api.model.SdxDatabaseRequest) Test(org.junit.jupiter.api.Test)

Example 18 with SdxDatabaseRequest

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());
}
Also used : CloudPlatform(com.sequenceiq.cloudbreak.common.mappable.CloudPlatform) SdxCluster(com.sequenceiq.datalake.entity.SdxCluster) SdxDatabaseRequest(com.sequenceiq.sdx.api.model.SdxDatabaseRequest) Test(org.junit.jupiter.api.Test)

Example 19 with SdxDatabaseRequest

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());
}
Also used : CloudPlatform(com.sequenceiq.cloudbreak.common.mappable.CloudPlatform) SdxCluster(com.sequenceiq.datalake.entity.SdxCluster) SdxDatabaseRequest(com.sequenceiq.sdx.api.model.SdxDatabaseRequest) Test(org.junit.jupiter.api.Test)

Example 20 with SdxDatabaseRequest

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());
}
Also used : CloudPlatform(com.sequenceiq.cloudbreak.common.mappable.CloudPlatform) SdxCluster(com.sequenceiq.datalake.entity.SdxCluster) SdxDatabaseRequest(com.sequenceiq.sdx.api.model.SdxDatabaseRequest) Test(org.junit.jupiter.api.Test)

Aggregations

SdxDatabaseRequest (com.sequenceiq.sdx.api.model.SdxDatabaseRequest)29 Description (com.sequenceiq.it.cloudbreak.context.Description)15 Test (org.testng.annotations.Test)15 SdxTestClient (com.sequenceiq.it.cloudbreak.client.SdxTestClient)10 TestContext (com.sequenceiq.it.cloudbreak.context.TestContext)10 Inject (javax.inject.Inject)10 CloudPlatform (com.sequenceiq.cloudbreak.common.mappable.CloudPlatform)9 RunningParameter.key (com.sequenceiq.it.cloudbreak.context.RunningParameter.key)9 SdxInternalTestDto (com.sequenceiq.it.cloudbreak.dto.sdx.SdxInternalTestDto)9 SdxClusterStatusResponse (com.sequenceiq.sdx.api.model.SdxClusterStatusResponse)9 SdxCluster (com.sequenceiq.datalake.entity.SdxCluster)8 SdxTestDto (com.sequenceiq.it.cloudbreak.dto.sdx.SdxTestDto)8 UseSpotInstances (com.sequenceiq.it.cloudbreak.util.spot.UseSpotInstances)8 SdxDatabaseAvailabilityType (com.sequenceiq.sdx.api.model.SdxDatabaseAvailabilityType)8 Test (org.junit.jupiter.api.Test)8 TestFailException (com.sequenceiq.it.cloudbreak.exception.TestFailException)5 AbstractE2ETest (com.sequenceiq.it.cloudbreak.testcase.e2e.AbstractE2ETest)5 HostGroupType (com.sequenceiq.it.cloudbreak.cloud.HostGroupType)4 FreeIpaTestDto (com.sequenceiq.it.cloudbreak.dto.freeipa.FreeIpaTestDto)4 List (java.util.List)4