Search in sources :

Example 26 with BaseFileSystemConfigurationsView

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));
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) StorageLocationView(com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView) BaseFileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView) ArrayList(java.util.ArrayList) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) StorageLocation(com.sequenceiq.cloudbreak.domain.StorageLocation) Test(org.junit.Test)

Aggregations

BaseFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView)26 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)20 Test (org.junit.Test)16 Builder (com.sequenceiq.cloudbreak.template.TemplatePreparationObject.Builder)10 ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)9 CmTemplateProcessor (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor)7 StorageLocationView (com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView)7 AccountMappingView (com.sequenceiq.cloudbreak.template.views.AccountMappingView)7 FileSystem (com.sequenceiq.cloudbreak.domain.FileSystem)6 StorageLocation (com.sequenceiq.cloudbreak.domain.StorageLocation)5 Gateway (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway)5 ConfigQueryEntries (com.sequenceiq.common.api.cloudstorage.query.ConfigQueryEntries)5 ArrayList (java.util.ArrayList)5 S3FileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView)4 HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)4 S3FileSystem (com.sequenceiq.common.api.filesystem.S3FileSystem)4 Json (com.sequenceiq.cloudbreak.common.json.Json)3 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)3 Test (org.junit.jupiter.api.Test)3 VirtualGroupRequest (com.sequenceiq.cloudbreak.auth.altus.VirtualGroupRequest)2