use of com.sequenceiq.cloudbreak.template.views.AccountMappingView in project cloudbreak by hortonworks.
the class KnoxIdBrokerConfigProviderTest method getRoleConfigWhenIdBrokerAndNoFileSystemAndAws.
@Test
public void getRoleConfigWhenIdBrokerAndNoFileSystemAndAws() {
TemplatePreparationObject tpo = new Builder().withCloudPlatform(CloudPlatform.AWS).withAccountMappingView(new AccountMappingView(GROUP_MAPPINGS, USER_MAPPINGS)).build();
List<ApiClusterTemplateConfig> result = underTest.getRoleConfigs(IDBROKER, tpo);
Map<String, String> configNameToValueMap = getConfigNameToValueMap(result);
assertThat(configNameToValueMap).containsOnly(Map.entry(IDBROKER_AWS_USER_MAPPING, USER_MAPPINGS_STR), Map.entry(IDBROKER_AWS_GROUP_MAPPING, GROUP_MAPPINGS_STR));
Map<String, String> configNameToVariableNameMap = getConfigNameToVariableNameMap(result);
assertThat(configNameToVariableNameMap).isEmpty();
}
use of com.sequenceiq.cloudbreak.template.views.AccountMappingView in project cloudbreak by hortonworks.
the class KnoxIdBrokerConfigProviderTest method getRoleConfigWhenIdBrokerAndAdlsGen2FileSystemAndInvalidCMVersion.
@Test
public void getRoleConfigWhenIdBrokerAndAdlsGen2FileSystemAndInvalidCMVersion() {
BaseFileSystemConfigurationsView fileSystemConfigurationsView = mock(BaseFileSystemConfigurationsView.class);
when(fileSystemConfigurationsView.getType()).thenReturn("ADLS_GEN_2");
TemplatePreparationObject tpo = new Builder().withCloudPlatform(CloudPlatform.AZURE).withFileSystemConfigurationView(fileSystemConfigurationsView).withAccountMappingView(new AccountMappingView(GROUP_MAPPINGS, USER_MAPPINGS)).withProductDetails(generateCMRepo(CMRepositoryVersionUtil.CLOUDERAMANAGER_VERSION_6_3_0), null).build();
List<ApiClusterTemplateConfig> result = underTest.getRoleConfigs(IDBROKER, tpo);
Map<String, String> configNameToValueMap = getConfigNameToValueMap(result);
assertThat(configNameToValueMap).containsOnly(Map.entry(IDBROKER_AZURE_USER_MAPPING, USER_MAPPINGS_STR), Map.entry(IDBROKER_AZURE_GROUP_MAPPING, GROUP_MAPPINGS_STR));
Map<String, String> configNameToVariableNameMap = getConfigNameToVariableNameMap(result);
assertThat(configNameToVariableNameMap).isEmpty();
}
use of com.sequenceiq.cloudbreak.template.views.AccountMappingView in project cloudbreak by hortonworks.
the class KnoxIdBrokerConfigProviderTest method getRoleConfigWhenIdBrokerAndWasbIntegratedFileSystem.
@Test
public void getRoleConfigWhenIdBrokerAndWasbIntegratedFileSystem() {
BaseFileSystemConfigurationsView fileSystemConfigurationsView = mock(BaseFileSystemConfigurationsView.class);
when(fileSystemConfigurationsView.getType()).thenReturn("WASB_INTEGRATED");
TemplatePreparationObject tpo = new Builder().withCloudPlatform(CloudPlatform.AZURE).withFileSystemConfigurationView(fileSystemConfigurationsView).withAccountMappingView(new AccountMappingView(GROUP_MAPPINGS, USER_MAPPINGS)).withProductDetails(generateCMRepo(CMRepositoryVersionUtil.CLOUDERAMANAGER_VERSION_7_1_0), null).build();
List<ApiClusterTemplateConfig> result = underTest.getRoleConfigs(IDBROKER, tpo);
Map<String, String> configNameToValueMap = getConfigNameToValueMap(result);
assertThat(configNameToValueMap).containsOnly(Map.entry(IDBROKER_AZURE_USER_MAPPING, USER_MAPPINGS_STR), Map.entry(IDBROKER_AZURE_GROUP_MAPPING, GROUP_MAPPINGS_STR));
Map<String, String> configNameToVariableNameMap = getConfigNameToVariableNameMap(result);
assertThat(configNameToVariableNameMap).isEmpty();
}
use of com.sequenceiq.cloudbreak.template.views.AccountMappingView in project cloudbreak by hortonworks.
the class KnoxIdBrokerConfigProviderTest method getRoleConfigWhenIdBrokerAndAdlsGen2FileSystemAndValidCMVersionValidEntity.
@Test
public void getRoleConfigWhenIdBrokerAndAdlsGen2FileSystemAndValidCMVersionValidEntity() {
BaseFileSystemConfigurationsView fileSystemConfigurationsView = mock(BaseFileSystemConfigurationsView.class);
when(fileSystemConfigurationsView.getType()).thenReturn("ADLS_GEN_2");
when(fileSystemConfigurationsView.getIdBrokerIdentityId()).thenReturn(MANAGED_IDENTITY_STR);
TemplatePreparationObject tpo = new Builder().withCloudPlatform(CloudPlatform.AZURE).withFileSystemConfigurationView(fileSystemConfigurationsView).withAccountMappingView(new AccountMappingView(GROUP_MAPPINGS, USER_MAPPINGS)).withProductDetails(generateCMRepo(CMRepositoryVersionUtil.CLOUDERAMANAGER_VERSION_7_1_0), null).build();
List<ApiClusterTemplateConfig> result = underTest.getRoleConfigs(IDBROKER, tpo);
Map<String, String> configNameToValueMap = getConfigNameToValueMap(result);
assertThat(configNameToValueMap).containsOnly(Map.entry(IDBROKER_AZURE_USER_MAPPING, USER_MAPPINGS_STR), Map.entry(IDBROKER_AZURE_GROUP_MAPPING, GROUP_MAPPINGS_STR), Map.entry(IDBROKER_AZURE_VM_ASSUMER_IDENTITY, MANAGED_IDENTITY_STR));
Map<String, String> configNameToVariableNameMap = getConfigNameToVariableNameMap(result);
assertThat(configNameToVariableNameMap).isEmpty();
}
use of com.sequenceiq.cloudbreak.template.views.AccountMappingView in project cloudbreak by hortonworks.
the class KnoxIdBrokerConfigProviderTest method getRoleConfigWhenIdBrokerAndNoFileSystemAndYarn.
@Test
public void getRoleConfigWhenIdBrokerAndNoFileSystemAndYarn() {
TemplatePreparationObject tpo = new Builder().withCloudPlatform(CloudPlatform.YARN).withAccountMappingView(new AccountMappingView(GROUP_MAPPINGS, USER_MAPPINGS)).build();
List<ApiClusterTemplateConfig> result = underTest.getRoleConfigs(IDBROKER, tpo);
Map<String, String> configNameToValueMap = getConfigNameToValueMap(result);
assertThat(configNameToValueMap).isEmpty();
Map<String, String> configNameToVariableNameMap = getConfigNameToVariableNameMap(result);
assertThat(configNameToVariableNameMap).isEmpty();
}
Aggregations