@Test public void getKafkaPropertiesWhenNoHdfsInClusterShouldPresentCoreSettings() { CoreConfigProvider coreConfigProvider = new CoreConfigProvider(); ReflectionTestUtils.setField(coreConfigProvider, "s3GuardConfigProvider", s3GuardConfigProvider); List<CmTemplateComponentConfigProvider> cmTemplateComponentConfigProviders = List.of(coreConfigProvider); ReflectionTestUtils.setField(cmTemplateComponentConfigProviderProcessor, "providers", cmTemplateComponentConfigProviders); S3FileSystem s3FileSystem = new S3FileSystem(); s3FileSystem.setInstanceProfile("profile"); s3FileSystem.setS3GuardDynamoTableName("cb-table"); s3FileSystem.setStorageContainer("cloudbreak-bucket"); StorageLocation storageLocation = new StorageLocation(); storageLocation.setProperty("core_defaultfs"); storageLocation.setValue("s3a: storageLocation.setConfigFile("core_settings"); StorageLocationView storageLocationView = new StorageLocationView(storageLocation); BaseFileSystemConfigurationsView baseFileSystemConfigurationsView = new S3FileSystemConfigurationsView(s3FileSystem, Sets.newHashSet(storageLocationView), false); when(templatePreparationObject.getFileSystemConfigurationView()).thenReturn(Optional.of(baseFileSystemConfigurationsView)); when(templatePreparationObject.getGatewayView()).thenReturn(new GatewayView(new Gateway(), "signkey", new HashSet<>())); Set<HostgroupView> hostgroupViews = new HashSet<>(); hostgroupViews.add(new HostgroupView("master", 1, InstanceGroupType.GATEWAY, 1)); when(templatePreparationObject.getHostgroupViews()).thenReturn(hostgroupViews); when(templatePreparationObject.getGatewayView()).thenReturn(new GatewayView(new Gateway(), "signkey", new HashSet<>())); when(blueprintView.getBlueprintText()).thenReturn(getBlueprintText("input/kafka-without-hdfs.bp")); String generated = generator.getBlueprintText(templatePreparationObject); String expected = new CmTemplateProcessor(getBlueprintText("output/kafka-without-hdfs.bp")).getTemplate().toString(); String output = new CmTemplateProcessor(generated).getTemplate().toString(); Assert.assertEquals(expected, output); }
@Override public String getBlueprintText(TemplatePreparationObject source) { ApiClusterTemplate template = getCmTemplate(source, Map.of(), null, null, null); return JsonUtil.writeValueAsStringSilent(template); }
CentralCmTemplateUpdater implements BlueprintUpdater { @Override public String getBlueprintText(TemplatePreparationObject source) { ApiClusterTemplate template = getCmTemplate(source, Map.of(), null, null, null); return JsonUtil.writeValueAsStringSilent(template); } }
CentralCmTemplateUpdater implements BlueprintUpdater { @Override public String getBlueprintText(TemplatePreparationObject source) { ApiClusterTemplate template = getCmTemplate(source, Map.of(), null, null, null); return JsonUtil.writeValueAsStringSilent(template); }  }
CentralCmTemplateUpdater implements BlueprintUpdater { @Override public String getBlueprintText(TemplatePreparationObject source) { ApiClusterTemplate template = getCmTemplate(source, Map.of(), null, null, null); return JsonUtil.writeValueAsStringSilent(template); }  ApiClusterTemplate getCmTemplate(TemplatePreparationObject source, Map<String, List<Map<String, String>>> hostGroupMappings,
            ClouderaManagerRepo clouderaManagerRepoDetails, List<ClouderaManagerProduct> clouderaManagerProductDetails, String sdxContextName); CmTemplateProcessor getCmTemplateProcessor(TemplatePreparationObject source); @Override String getBlueprintText(TemplatePreparationObject source); @Override String getVariant(); }
CentralCmTemplateUpdater implements BlueprintUpdater { @Override public String getBlueprintText(TemplatePreparationObject source) { ApiClusterTemplate template = getCmTemplate(source, Map.of(), null, null, null); return JsonUtil.writeValueAsStringSilent(template); }  ApiClusterTemplate getCmTemplate(TemplatePreparationObject source, Map<String, List<Map<String, String>>> hostGroupMappings,
            ClouderaManagerRepo clouderaManagerRepoDetails, List<ClouderaManagerProduct> clouderaManagerProductDetails, String sdxContextName); CmTemplateProcessor getCmTemplateProcessor(TemplatePreparationObject source); @Override String getBlueprintText(TemplatePreparationObject source); @Override String getVariant();  }