Search in sources :

Example 36 with Builder

use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject.Builder in project cloudbreak by hortonworks.

the class DasConfigProviderTest method getRoleConfigs.

@Test
public void getRoleConfigs() {
    TemplatePreparationObject tpo = new Builder().build();
    List<ApiClusterTemplateConfig> result = underTest.getRoleConfigs(DasRoles.WEBAPP, tpo);
    Map<String, String> paramToVariable = result.stream().collect(Collectors.toMap(ApiClusterTemplateConfig::getName, ApiClusterTemplateConfig::getValue));
    assertThat(paramToVariable).containsOnly(new SimpleEntry<>("data_analytics_studio_user_authentication", "KNOX_PROXY"));
    result = underTest.getRoleConfigs(DasRoles.EVENTPROCESSOR, tpo);
    assertThat(result.isEmpty()).isTrue();
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) Builder(com.sequenceiq.cloudbreak.template.TemplatePreparationObject.Builder) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) Test(org.junit.Test)

Example 37 with Builder

use of com.sequenceiq.cloudbreak.template.TemplatePreparationObject.Builder in project cloudbreak by hortonworks.

the class QueryProcessorConfigProviderTest method isConfigurationNeededFalseWhenNoDBRegistered.

@Test
@SuppressWarnings("unchecked")
public void isConfigurationNeededFalseWhenNoDBRegistered() {
    CmTemplateProcessor mockTemplateProcessor = mock(CmTemplateProcessor.class);
    when(mockTemplateProcessor.isRoleTypePresentInService(QueryStoreRoles.QUERY_PROCESSOR, List.of(QueryStoreRoles.QUERY_PROCESSOR))).thenReturn(true);
    TemplatePreparationObject tpo = new Builder().build();
    boolean result = underTest.isConfigurationNeeded(mockTemplateProcessor, tpo);
    assertThat(result).isFalse();
}
Also used : TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) Builder(com.sequenceiq.cloudbreak.template.TemplatePreparationObject.Builder) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) Test(org.junit.jupiter.api.Test)

Aggregations

Builder (com.sequenceiq.cloudbreak.template.TemplatePreparationObject.Builder)37 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)35 Test (org.junit.Test)30 ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)19 RDSConfig (com.sequenceiq.cloudbreak.domain.RDSConfig)14 AccountMappingView (com.sequenceiq.cloudbreak.template.views.AccountMappingView)12 CmTemplateProcessor (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor)10 BaseFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView)10 BlueprintView (com.sequenceiq.cloudbreak.template.views.BlueprintView)9 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)9 Gateway (com.sequenceiq.cloudbreak.domain.stack.cluster.gateway.Gateway)7 GeneralClusterConfigs (com.sequenceiq.cloudbreak.template.model.GeneralClusterConfigs)6 List (java.util.List)6 ApiClusterTemplateVariable (com.cloudera.api.swagger.model.ApiClusterTemplateVariable)5 HashSet (java.util.HashSet)5 Test (org.junit.jupiter.api.Test)4 VirtualGroupRequest (com.sequenceiq.cloudbreak.auth.altus.VirtualGroupRequest)2 CloudCredential (com.sequenceiq.cloudbreak.cloud.model.CloudCredential)2 ClouderaManagerProduct (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct)2 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)2