Search in sources :

Example 1 with SCHEMA_REGISTRY_SERVER

use of com.sequenceiq.cloudbreak.cmtemplate.configproviders.schemaregistry.SchemaRegistryRoles.SCHEMA_REGISTRY_SERVER in project cloudbreak by hortonworks.

the class SchemaRegistryJarStorageConfigProviderTest method getTemplatePreparationObject.

private TemplatePreparationObject getTemplatePreparationObject(Integer... instanceCountsForSchemaRegistryHostGroups) {
    List<HostgroupView> srHostGroups = Arrays.stream(instanceCountsForSchemaRegistryHostGroups).map(nodeCnt -> new HostgroupView(null, 0, InstanceGroupType.CORE, nodeCnt)).collect(toList());
    TemplatePreparationObject tpo = mock(TemplatePreparationObject.class, withSettings().lenient());
    when(tpo.getHostGroupsWithComponent(SCHEMA_REGISTRY_SERVER)).thenAnswer(__ -> srHostGroups.stream());
    when(tpo.getBlueprintView()).thenReturn(blueprintView);
    return tpo;
}
Also used : VolumeConfigProviderTestHelper.hostGroupWithVolumeCount(com.sequenceiq.cloudbreak.cmtemplate.configproviders.VolumeConfigProviderTestHelper.hostGroupWithVolumeCount) Arrays(java.util.Arrays) ConfigUtils.config(com.sequenceiq.cloudbreak.cmtemplate.configproviders.ConfigUtils.config) Mock(org.mockito.Mock) BlueprintView(com.sequenceiq.cloudbreak.template.views.BlueprintView) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) CONFIG_JAR_STORAGE_DIRECTORY_PATH(com.sequenceiq.cloudbreak.cmtemplate.configproviders.schemaregistry.SchemaRegistryJarStorageConfigProvider.CONFIG_JAR_STORAGE_DIRECTORY_PATH) FileReaderUtils(com.sequenceiq.cloudbreak.util.FileReaderUtils) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) MockitoExtension(org.mockito.junit.jupiter.MockitoExtension) Set(java.util.Set) CONFIG_JAR_STORAGE_TYPE(com.sequenceiq.cloudbreak.cmtemplate.configproviders.schemaregistry.SchemaRegistryJarStorageConfigProvider.CONFIG_JAR_STORAGE_TYPE) SCHEMA_REGISTRY_SERVER(com.sequenceiq.cloudbreak.cmtemplate.configproviders.schemaregistry.SchemaRegistryRoles.SCHEMA_REGISTRY_SERVER) Mockito.when(org.mockito.Mockito.when) TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) InstanceGroupType(com.sequenceiq.common.api.type.InstanceGroupType) Test(org.junit.jupiter.api.Test) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView) Collectors.toList(java.util.stream.Collectors.toList) List(java.util.List) Optional(java.util.Optional) Mockito.withSettings(org.mockito.Mockito.withSettings) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) SchemaRegistryJarStorageConfigProvider.getSchemaRegistryInstanceCount(com.sequenceiq.cloudbreak.cmtemplate.configproviders.schemaregistry.SchemaRegistryJarStorageConfigProvider.getSchemaRegistryInstanceCount) Mockito.mock(org.mockito.Mockito.mock) TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) HostgroupView(com.sequenceiq.cloudbreak.template.views.HostgroupView)

Aggregations

CmTemplateProcessor (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor)1 ConfigUtils.config (com.sequenceiq.cloudbreak.cmtemplate.configproviders.ConfigUtils.config)1 VolumeConfigProviderTestHelper.hostGroupWithVolumeCount (com.sequenceiq.cloudbreak.cmtemplate.configproviders.VolumeConfigProviderTestHelper.hostGroupWithVolumeCount)1 CONFIG_JAR_STORAGE_DIRECTORY_PATH (com.sequenceiq.cloudbreak.cmtemplate.configproviders.schemaregistry.SchemaRegistryJarStorageConfigProvider.CONFIG_JAR_STORAGE_DIRECTORY_PATH)1 CONFIG_JAR_STORAGE_TYPE (com.sequenceiq.cloudbreak.cmtemplate.configproviders.schemaregistry.SchemaRegistryJarStorageConfigProvider.CONFIG_JAR_STORAGE_TYPE)1 SchemaRegistryJarStorageConfigProvider.getSchemaRegistryInstanceCount (com.sequenceiq.cloudbreak.cmtemplate.configproviders.schemaregistry.SchemaRegistryJarStorageConfigProvider.getSchemaRegistryInstanceCount)1 SCHEMA_REGISTRY_SERVER (com.sequenceiq.cloudbreak.cmtemplate.configproviders.schemaregistry.SchemaRegistryRoles.SCHEMA_REGISTRY_SERVER)1 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)1 BlueprintView (com.sequenceiq.cloudbreak.template.views.BlueprintView)1 HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)1 FileReaderUtils (com.sequenceiq.cloudbreak.util.FileReaderUtils)1 InstanceGroupType (com.sequenceiq.common.api.type.InstanceGroupType)1 Arrays (java.util.Arrays)1 List (java.util.List)1 Optional (java.util.Optional)1 Set (java.util.Set)1 Collectors.toList (java.util.stream.Collectors.toList)1 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)1 Test (org.junit.jupiter.api.Test)1 ExtendWith (org.junit.jupiter.api.extension.ExtendWith)1