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);
}
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());
}
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());
}
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());
}
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;
}
Aggregations