use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.
the class StackV4RequestToTemplatePreparationObjectConverterTest method testConvertWhenClusterHasNoCloudStorageThenFileSystemConfigurationViewShouldBeEmpty.
@Test
public void testConvertWhenClusterHasNoCloudStorageThenFileSystemConfigurationViewShouldBeEmpty() {
when(cluster.getCloudStorage()).thenReturn(null);
when(cloudStorageValidationUtil.isCloudStorageConfigured(null)).thenReturn(false);
TemplatePreparationObject result = underTest.convert(source);
assertFalse(result.getFileSystemConfigurationView().isPresent());
}
use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.
the class StackV4RequestToTemplatePreparationObjectConverterTest method testConvertWhenGatewayExistsInStack.
@Test
public void testConvertWhenGatewayExistsInStack() {
when(stackV4RequestToGatewayConverter.convert(source)).thenReturn(new Gateway());
when(cluster.getGateway()).thenReturn(new GatewayV4Request());
TemplatePreparationObject result = underTest.convert(source);
assertNotNull(result.getGatewayView());
}
use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.
the class StackV4RequestToTemplatePreparationObjectConverterTest method testMockAccountMappings.
@Test
public void testMockAccountMappings() {
TemplatePreparationObject result = underTest.convert(source);
AccountMappingView accountMappingView = result.getAccountMappingView();
assertNotNull(accountMappingView);
assertEquals(MOCK_GROUP_MAPPINGS, accountMappingView.getGroupMappings());
assertEquals(MOCK_USER_MAPPINGS, accountMappingView.getUserMappings());
}
use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.
the class StackV4RequestToTemplatePreparationObjectConverterTest method testConvertWhenProvidingDataThenBlueprintWithExpectedDataShouldBeStored.
@Test
public void testConvertWhenProvidingDataThenBlueprintWithExpectedDataShouldBeStored() {
String stackVersion = TEST_VERSION;
String stackType = "HDP";
when(blueprintStackInfo.getVersion()).thenReturn(stackVersion);
when(blueprintStackInfo.getType()).thenReturn(stackType);
BlueprintView expected = mock(BlueprintView.class);
when(blueprintViewProvider.getBlueprintView(blueprint)).thenReturn(expected);
TemplatePreparationObject result = underTest.convert(source);
assertSame(expected, result.getBlueprintView());
}
use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject in project cloudbreak by hortonworks.
the class StackV4RequestToTemplatePreparationObjectConverterTest method testStackPlacement.
@Test
public void testStackPlacement() {
TemplatePreparationObject result = underTest.convert(source);
assertTrue(result.getPlacementView().isPresent());
assertEquals(REGION, result.getPlacementView().get().getRegion());
assertEquals(REGION, result.getPlacementView().get().getAvailabilityZone());
}
Aggregations