@Test void inferContentXMLUnsupported() { assertThrows(MissingEnvironmentException.class, () -> tryInferContentTypeFromValue("<test1>1</test1><test2>2</test2>")); }
public static String tryInferContentTypeFromValue(final String value) { if (isBlank(value)) { return null; } char initial = value.trim().charAt(0); switch (initial) { case '[': case '{': return JSON; case '<': throw new MissingEnvironmentException("XML Environment Values are not yet supported."); default: return YAML; } }
EnvironmentConfigurationUtils { public static String tryInferContentTypeFromValue(final String value) { if (isBlank(value)) { return null; } char initial = value.trim().charAt(0); switch (initial) { case '[': case '{': return JSON; case '<': throw new MissingEnvironmentException("XML Environment Values are not yet supported."); default: return YAML; } } }
EnvironmentConfigurationUtils { public static String tryInferContentTypeFromValue(final String value) { if (isBlank(value)) { return null; } char initial = value.trim().charAt(0); switch (initial) { case '[': case '{': return JSON; case '<': throw new MissingEnvironmentException("XML Environment Values are not yet supported."); default: return YAML; } } @Inject  EnvironmentConfigurationUtils(JsonTools jsonTools, EntityLoaderRegistry entityLoaderRegistry,
                                  JsonFileUtils jsonFileUtils, final EntityTypeRegistry entityTypeRegistry); }
EnvironmentConfigurationUtils { public static String tryInferContentTypeFromValue(final String value) { if (isBlank(value)) { return null; } char initial = value.trim().charAt(0); switch (initial) { case '[': case '{': return JSON; case '<': throw new MissingEnvironmentException("XML Environment Values are not yet supported."); default: return YAML; } } @Inject  EnvironmentConfigurationUtils(JsonTools jsonTools, EntityLoaderRegistry entityLoaderRegistry,
                                  JsonFileUtils jsonFileUtils, final EntityTypeRegistry entityTypeRegistry); @SuppressWarnings("unchecked") Map<String, String> parseEnvironmentValues(Map providedEnvironmentValues); Pair<String, Map<String, String>> parseBundleMetadata(File metaDataFile, File configFolder); Map<String, String> loadConfigFolder(final File configFolder); @NotNull String loadConfigFromFile(File configFile, String entityType, String entityName); @NotNull Map<String, String> loadConfigFromFile(File configFile, String entityType); static String tryInferContentTypeFromValue(final String value); static DependentBundle generateDependentEnvBundleFromProject(final ProjectInfo projectInfo); static String extractEntityName(final String entityName); }
EnvironmentConfigurationUtils { public static String tryInferContentTypeFromValue(final String value) { if (isBlank(value)) { return null; } char initial = value.trim().charAt(0); switch (initial) { case '[': case '{': return JSON; case '<': throw new MissingEnvironmentException("XML Environment Values are not yet supported."); default: return YAML; } } @Inject  EnvironmentConfigurationUtils(JsonTools jsonTools, EntityLoaderRegistry entityLoaderRegistry,
                                  JsonFileUtils jsonFileUtils, final EntityTypeRegistry entityTypeRegistry); @SuppressWarnings("unchecked") Map<String, String> parseEnvironmentValues(Map providedEnvironmentValues); Pair<String, Map<String, String>> parseBundleMetadata(File metaDataFile, File configFolder); Map<String, String> loadConfigFolder(final File configFolder); @NotNull String loadConfigFromFile(File configFile, String entityType, String entityName); @NotNull Map<String, String> loadConfigFromFile(File configFile, String entityType); static String tryInferContentTypeFromValue(final String value); static DependentBundle generateDependentEnvBundleFromProject(final ProjectInfo projectInfo); static String extractEntityName(final String entityName);  }