@Test public void testGetSchemaRegistryRoleConfigs720() { String inputJson = loadBlueprint("7.2.0"); CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson); TemplatePreparationObject preparationObject = getTemplatePreparationObject(cmTemplateProcessor); List<ApiClusterTemplateConfig> roleConfigs = underTest.getRoleConfigs(NifiRegistryRoles.NIFI_REGISTRY_SERVER, preparationObject); assertThat(roleConfigs).hasSameElementsAs( List.of(config("nifi.registry.db.url", "jdbc:postgresql: config("nifi.registry.db.username", "nifi_registry_server_user"), config("nifi.registry.db.password", "nifi_registry_server_password"), config("nifi.registry.db.driver.class", "org.postgresql.Driver"), config("nifi.registry.db.driver.directory", "/usr/share/java/"))); }
@Override protected List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, TemplatePreparationObject source) { String cdhVersion = source.getBlueprintView().getProcessor().getStackVersion() == null ? "" : source.getBlueprintView().getProcessor().getStackVersion(); if (isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_0_1)) { RdsView nifiRegistryRdsView = getRdsView(source); switch (roleType) { case NifiRegistryRoles.NIFI_REGISTRY_SERVER: return List.of( config(DATABASE_URL, nifiRegistryRdsView.getConnectionURL()), config(DRIVER_DIRECTORY, "/usr/share/java/"), config(DRIVER_CLASS, nifiRegistryRdsView.getConnectionDriver()), config(DATABASE_USER, nifiRegistryRdsView.getConnectionUserName()), config(DATABASE_PASSWORD, nifiRegistryRdsView.getConnectionPassword()) ); default: return List.of(); } } return List.of(); }
NifiRegistryRoleConfigProvider extends AbstractRdsRoleConfigProvider { @Override protected List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, TemplatePreparationObject source) { String cdhVersion = source.getBlueprintView().getProcessor().getStackVersion() == null ? "" : source.getBlueprintView().getProcessor().getStackVersion(); if (isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_0_1)) { RdsView nifiRegistryRdsView = getRdsView(source); switch (roleType) { case NifiRegistryRoles.NIFI_REGISTRY_SERVER: return List.of( config(DATABASE_URL, nifiRegistryRdsView.getConnectionURL()), config(DRIVER_DIRECTORY, "/usr/share/java/"), config(DRIVER_CLASS, nifiRegistryRdsView.getConnectionDriver()), config(DATABASE_USER, nifiRegistryRdsView.getConnectionUserName()), config(DATABASE_PASSWORD, nifiRegistryRdsView.getConnectionPassword()) ); default: return List.of(); } } return List.of(); } }
NifiRegistryRoleConfigProvider extends AbstractRdsRoleConfigProvider { @Override protected List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, TemplatePreparationObject source) { String cdhVersion = source.getBlueprintView().getProcessor().getStackVersion() == null ? "" : source.getBlueprintView().getProcessor().getStackVersion(); if (isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_0_1)) { RdsView nifiRegistryRdsView = getRdsView(source); switch (roleType) { case NifiRegistryRoles.NIFI_REGISTRY_SERVER: return List.of( config(DATABASE_URL, nifiRegistryRdsView.getConnectionURL()), config(DRIVER_DIRECTORY, "/usr/share/java/"), config(DRIVER_CLASS, nifiRegistryRdsView.getConnectionDriver()), config(DATABASE_USER, nifiRegistryRdsView.getConnectionUserName()), config(DATABASE_PASSWORD, nifiRegistryRdsView.getConnectionPassword()) ); default: return List.of(); } } return List.of(); }  }
NifiRegistryRoleConfigProvider extends AbstractRdsRoleConfigProvider { @Override protected List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, TemplatePreparationObject source) { String cdhVersion = source.getBlueprintView().getProcessor().getStackVersion() == null ? "" : source.getBlueprintView().getProcessor().getStackVersion(); if (isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_0_1)) { RdsView nifiRegistryRdsView = getRdsView(source); switch (roleType) { case NifiRegistryRoles.NIFI_REGISTRY_SERVER: return List.of( config(DATABASE_URL, nifiRegistryRdsView.getConnectionURL()), config(DRIVER_DIRECTORY, "/usr/share/java/"), config(DRIVER_CLASS, nifiRegistryRdsView.getConnectionDriver()), config(DATABASE_USER, nifiRegistryRdsView.getConnectionUserName()), config(DATABASE_PASSWORD, nifiRegistryRdsView.getConnectionPassword()) ); default: return List.of(); } } return List.of(); }  @Override String getServiceType(); @Override List<String> getRoleTypes(); }
NifiRegistryRoleConfigProvider extends AbstractRdsRoleConfigProvider { @Override protected List<ApiClusterTemplateConfig> getRoleConfigs(String roleType, TemplatePreparationObject source) { String cdhVersion = source.getBlueprintView().getProcessor().getStackVersion() == null ? "" : source.getBlueprintView().getProcessor().getStackVersion(); if (isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_0_1)) { RdsView nifiRegistryRdsView = getRdsView(source); switch (roleType) { case NifiRegistryRoles.NIFI_REGISTRY_SERVER: return List.of( config(DATABASE_URL, nifiRegistryRdsView.getConnectionURL()), config(DRIVER_DIRECTORY, "/usr/share/java/"), config(DRIVER_CLASS, nifiRegistryRdsView.getConnectionDriver()), config(DATABASE_USER, nifiRegistryRdsView.getConnectionUserName()), config(DATABASE_PASSWORD, nifiRegistryRdsView.getConnectionPassword()) ); default: return List.of(); } } return List.of(); }  @Override String getServiceType(); @Override List<String> getRoleTypes();  }