Search in sources :

Example 1 with SharedServiceConfigsView

use of com.sequenceiq.cloudbreak.template.views.SharedServiceConfigsView in project cloudbreak by hortonworks.

the class StackToTemplatePreparationObjectConverterTest method testConvertWhenDataLakeIdNotNullThenExpectedSharedServiceConfigsShouldBeStored.

@Test
public void testConvertWhenDataLakeIdNotNullThenExpectedSharedServiceConfigsShouldBeStored() {
    // just in case adding one to avoid matching with the class variable
    SharedServiceConfigsView expected = new SharedServiceConfigsView();
    when(datalakeService.createSharedServiceConfigsView(stackMock)).thenReturn(expected);
    when(blueprintViewProvider.getBlueprintView(any())).thenReturn(getBlueprintView());
    TemplatePreparationObject result = underTest.convert(stackMock);
    assertThat(result.getSharedServiceConfigs().isPresent()).isTrue();
    assertThat(result.getSharedServiceConfigs().get()).isEqualTo(expected);
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) SharedServiceConfigsView(com.sequenceiq.cloudbreak.template.views.SharedServiceConfigsView) Test(org.junit.jupiter.api.Test)

Example 2 with SharedServiceConfigsView

use of com.sequenceiq.cloudbreak.template.views.SharedServiceConfigsView in project cloudbreak by hortonworks.

the class DatalakeServiceTest method testCreateSharedServiceConfigsViewByCrn.

@Test
public void testCreateSharedServiceConfigsViewByCrn() {
    Stack stack = new Stack();
    Cluster cluster = new Cluster();
    stack.setCluster(cluster);
    stack.setDatalakeCrn("crn");
    stack.setType(StackType.WORKLOAD);
    SharedServiceConfigsView res = underTest.createSharedServiceConfigsView(stack);
    verify(stackService, times(1)).getByCrnOrElseNull("crn");
    Assertions.assertFalse(res.isDatalakeCluster());
}
Also used : Cluster(com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster) SharedServiceConfigsView(com.sequenceiq.cloudbreak.template.views.SharedServiceConfigsView) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) Test(org.junit.jupiter.api.Test)

Example 3 with SharedServiceConfigsView

use of com.sequenceiq.cloudbreak.template.views.SharedServiceConfigsView in project cloudbreak by hortonworks.

the class DatalakeServiceTest method testCreateSharedServiceConfigsViewWhenDatahubButDatalakeCrnIsMissing.

@Test
public void testCreateSharedServiceConfigsViewWhenDatahubButDatalakeCrnIsMissing() {
    Stack stack = new Stack();
    Cluster cluster = new Cluster();
    stack.setCluster(cluster);
    stack.setType(StackType.WORKLOAD);
    SharedServiceConfigsView res = underTest.createSharedServiceConfigsView(stack);
    verify(stackService, times(0)).getByCrnOrElseNull("crn");
    Assertions.assertFalse(res.isDatalakeCluster());
}
Also used : Cluster(com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster) SharedServiceConfigsView(com.sequenceiq.cloudbreak.template.views.SharedServiceConfigsView) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) Test(org.junit.jupiter.api.Test)

Example 4 with SharedServiceConfigsView

use of com.sequenceiq.cloudbreak.template.views.SharedServiceConfigsView in project cloudbreak by hortonworks.

the class DatalakeServiceTest method testCreateSharedServiceConfigsViewFromBlueprintUtilsWhenDatalake.

@Test
public void testCreateSharedServiceConfigsViewFromBlueprintUtilsWhenDatalake() {
    Stack stack = new Stack();
    Cluster cluster = new Cluster();
    stack.setCluster(cluster);
    stack.setType(StackType.DATALAKE);
    SharedServiceConfigsView res = underTest.createSharedServiceConfigsView(stack);
    verify(stackService, times(0)).getByCrnOrElseNull("crn");
    Assertions.assertTrue(res.isDatalakeCluster());
}
Also used : Cluster(com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster) SharedServiceConfigsView(com.sequenceiq.cloudbreak.template.views.SharedServiceConfigsView) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) Test(org.junit.jupiter.api.Test)

Example 5 with SharedServiceConfigsView

use of com.sequenceiq.cloudbreak.template.views.SharedServiceConfigsView in project cloudbreak by hortonworks.

the class RecipeModulTestModelProvider method datalakeSharedServiceConfig.

private static SharedServiceConfigsView datalakeSharedServiceConfig() {
    SharedServiceConfigsView sharedServiceConfigsView = new SharedServiceConfigsView();
    sharedServiceConfigsView.setDatalakeCluster(true);
    return sharedServiceConfigsView;
}
Also used : SharedServiceConfigsView(com.sequenceiq.cloudbreak.template.views.SharedServiceConfigsView)

Aggregations

SharedServiceConfigsView (com.sequenceiq.cloudbreak.template.views.SharedServiceConfigsView)7 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)4 Test (org.junit.jupiter.api.Test)4 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)3 CmTemplateProcessor (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor)1 StorageLocation (com.sequenceiq.cloudbreak.domain.StorageLocation)1 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)1 StorageLocationView (com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView)1 S3FileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView)1 GeneralClusterConfigs (com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs)1 BlueprintView (com.sequenceiq.cloudbreak.template.views.BlueprintView)1 HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)1 S3FileSystem (com.sequenceiq.common.api.filesystem.S3FileSystem)1 ArrayList (java.util.ArrayList)1