use of com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView in project cloudbreak by hortonworks.
the class CoreConfigProviderTest method isConfigurationNeededWhenNotPresentedHdfsNotAndStorageConfiguredMustReturnTrue.
@Test
public void isConfigurationNeededWhenNotPresentedHdfsNotAndStorageConfiguredMustReturnTrue() {
CmTemplateProcessor mockTemplateProcessor = mock(CmTemplateProcessor.class);
TemplatePreparationObject templatePreparationObject = mock(TemplatePreparationObject.class);
BaseFileSystemConfigurationsView fileSystemConfiguration = mock(BaseFileSystemConfigurationsView.class);
List<StorageLocationView> storageLocationViews = new ArrayList<>();
StorageLocation storageLocation = new StorageLocation();
storageLocation.setConfigFile("core_defaultfs1");
storageLocation.setProperty("core_defaultfs1");
storageLocation.setValue("s3a://default-bucket/");
storageLocationViews.add(new StorageLocationView(storageLocation));
when(fileSystemConfiguration.getLocations()).thenReturn(storageLocationViews);
Optional<BaseFileSystemConfigurationsView> fileSystemConfigurationView = Optional.of(fileSystemConfiguration);
when(mockTemplateProcessor.isRoleTypePresentInService(HDFS, List.of(NAMENODE))).thenReturn(false);
when(templatePreparationObject.getFileSystemConfigurationView()).thenReturn(fileSystemConfigurationView);
Assert.assertFalse(underTest.isConfigurationNeeded(mockTemplateProcessor, templatePreparationObject));
}
Aggregations