@Test public void shouldParseEmptyMap() throws Exception { Map<String, String> result = DefaultConfiguration.parseMap(""); assertThat(result).hasSize(0); }
public static Map<String, String> parseMap(String s) throws IOException { if (Strings.isNullOrEmpty(s)) { return Collections.EMPTY_MAP; } Properties properties = new Properties(); try (InputStream is = new ByteArrayInputStream(s.getBytes(Charset.defaultCharset()))) { properties.load(is); } Map<String, String> map = new HashMap<>(); for (String key : properties.stringPropertyNames()) { map.put(key, properties.getProperty(key)); } return map; }
DefaultConfiguration implements Configuration { public static Map<String, String> parseMap(String s) throws IOException { if (Strings.isNullOrEmpty(s)) { return Collections.EMPTY_MAP; } Properties properties = new Properties(); try (InputStream is = new ByteArrayInputStream(s.getBytes(Charset.defaultCharset()))) { properties.load(is); } Map<String, String> map = new HashMap<>(); for (String key : properties.stringPropertyNames()) { map.put(key, properties.getProperty(key)); } return map; } }
DefaultConfiguration implements Configuration { public static Map<String, String> parseMap(String s) throws IOException { if (Strings.isNullOrEmpty(s)) { return Collections.EMPTY_MAP; } Properties properties = new Properties(); try (InputStream is = new ByteArrayInputStream(s.getBytes(Charset.defaultCharset()))) { properties.load(is); } Map<String, String> map = new HashMap<>(); for (String key : properties.stringPropertyNames()) { map.put(key, properties.getProperty(key)); } return map; } DefaultConfiguration(String sessionId, URL masterUrl, String namespace, Map<String, String> scriptEnvironmentVariables,  URL environmentSetupScriptUrl,
        URL environmentTeardownScriptUrl, URL environmentConfigUrl, List<URL> environmentDependencies, boolean namespaceUseCurrentEnabled,
        boolean namespaceLazyCreateEnabled, boolean namespaceCleanupEnabled, long namespaceCleanupTimeout,
        boolean namespaceCleanupConfirmationEnabled, boolean namespaceDestroyEnabled,
        boolean namespaceDestroyConfirmationEnabled, long namespaceDestroyTimeout, boolean waitEnabled, long waitTimeout,
        long waitPollInterval, List<String> waitForServiceList, boolean ansiLoggerEnabled, boolean environmentInitEnabled, boolean logCopyEnabled,
        String logPath, String kubernetesDomain, String dockerRegistry, String token, String username, String password,
        String apiVersion, boolean trustCerts, boolean fmpBuildEnabled, boolean fmpBuildForMavenDisable,
        boolean fmpDebugOutput, boolean fmpLogsEnabled, String fmpPomPath, List<String> fmpProfiles,
        List<String> fmpSystemProperties, String fmpBuildOptions); }
DefaultConfiguration implements Configuration { public static Map<String, String> parseMap(String s) throws IOException { if (Strings.isNullOrEmpty(s)) { return Collections.EMPTY_MAP; } Properties properties = new Properties(); try (InputStream is = new ByteArrayInputStream(s.getBytes(Charset.defaultCharset()))) { properties.load(is); } Map<String, String> map = new HashMap<>(); for (String key : properties.stringPropertyNames()) { map.put(key, properties.getProperty(key)); } return map; } DefaultConfiguration(String sessionId, URL masterUrl, String namespace, Map<String, String> scriptEnvironmentVariables,  URL environmentSetupScriptUrl,
        URL environmentTeardownScriptUrl, URL environmentConfigUrl, List<URL> environmentDependencies, boolean namespaceUseCurrentEnabled,
        boolean namespaceLazyCreateEnabled, boolean namespaceCleanupEnabled, long namespaceCleanupTimeout,
        boolean namespaceCleanupConfirmationEnabled, boolean namespaceDestroyEnabled,
        boolean namespaceDestroyConfirmationEnabled, long namespaceDestroyTimeout, boolean waitEnabled, long waitTimeout,
        long waitPollInterval, List<String> waitForServiceList, boolean ansiLoggerEnabled, boolean environmentInitEnabled, boolean logCopyEnabled,
        String logPath, String kubernetesDomain, String dockerRegistry, String token, String username, String password,
        String apiVersion, boolean trustCerts, boolean fmpBuildEnabled, boolean fmpBuildForMavenDisable,
        boolean fmpDebugOutput, boolean fmpLogsEnabled, String fmpPomPath, List<String> fmpProfiles,
        List<String> fmpSystemProperties, String fmpBuildOptions); static DefaultConfiguration fromMap(Map<String, String> map); static String getDockerRegistry(Map<String, String> map); static URL getKubernetesConfigurationUrl(Map<String, String> map); static URL findConfigResource(String resourceName); static URL asUrlOrResource(String s); static Map<String, String> parseMap(String s); @Override String getSessionId(); @Override String getNamespace(); @Override URL getMasterUrl(); @Override Map<String, String> getScriptEnvironmentVariables(); URL getEnvironmentSetupScriptUrl(); @Override URL getEnvironmentTeardownScriptUrl(); @Override URL getEnvironmentConfigUrl(); @Override List<URL> getEnvironmentDependencies(); @Override boolean isNamespaceLazyCreateEnabled(); @Override boolean isNamespaceCleanupEnabled(); @Override long getNamespaceCleanupTimeout(); @Override boolean isNamespaceCleanupConfirmationEnabled(); @Override boolean isNamespaceDestroyEnabled(); @Override boolean isNamespaceDestroyConfirmationEnabled(); @Override boolean isNamespaceUseCurrentEnabled(); @Override long getNamespaceDestroyTimeout(); @Override boolean isWaitEnabled(); @Override long getWaitTimeout(); @Override long getWaitPollInterval(); @Override List<String> getWaitForServiceList(); @Override boolean isAnsiLoggerEnabled(); @Override boolean isEnvironmentInitEnabled(); @Override boolean isLogCopyEnabled(); @Override String getLogPath(); @Override String getKubernetesDomain(); @Override String getDockerRegistry(); boolean hasBasicAuth(); String getUsername(); String getPassword(); @Override String getApiVersion(); @Override String getToken(); @Override boolean isTrustCerts(); @Override boolean isFmpBuildForMavenDisable(); @Override boolean isFmpDebugOutput(); @Override boolean isFmpLogsEnabled(); @Override boolean isFmpBuildEnabled(); @Override String getFmpPomPath(); @Override String getFmpBuildOptions(); @Override List<String> getFmpProfiles(); @Override List<String> getFmpSystemProperties(); @Override String toString(); }
DefaultConfiguration implements Configuration { public static Map<String, String> parseMap(String s) throws IOException { if (Strings.isNullOrEmpty(s)) { return Collections.EMPTY_MAP; } Properties properties = new Properties(); try (InputStream is = new ByteArrayInputStream(s.getBytes(Charset.defaultCharset()))) { properties.load(is); } Map<String, String> map = new HashMap<>(); for (String key : properties.stringPropertyNames()) { map.put(key, properties.getProperty(key)); } return map; } DefaultConfiguration(String sessionId, URL masterUrl, String namespace, Map<String, String> scriptEnvironmentVariables,  URL environmentSetupScriptUrl,
        URL environmentTeardownScriptUrl, URL environmentConfigUrl, List<URL> environmentDependencies, boolean namespaceUseCurrentEnabled,
        boolean namespaceLazyCreateEnabled, boolean namespaceCleanupEnabled, long namespaceCleanupTimeout,
        boolean namespaceCleanupConfirmationEnabled, boolean namespaceDestroyEnabled,
        boolean namespaceDestroyConfirmationEnabled, long namespaceDestroyTimeout, boolean waitEnabled, long waitTimeout,
        long waitPollInterval, List<String> waitForServiceList, boolean ansiLoggerEnabled, boolean environmentInitEnabled, boolean logCopyEnabled,
        String logPath, String kubernetesDomain, String dockerRegistry, String token, String username, String password,
        String apiVersion, boolean trustCerts, boolean fmpBuildEnabled, boolean fmpBuildForMavenDisable,
        boolean fmpDebugOutput, boolean fmpLogsEnabled, String fmpPomPath, List<String> fmpProfiles,
        List<String> fmpSystemProperties, String fmpBuildOptions); static DefaultConfiguration fromMap(Map<String, String> map); static String getDockerRegistry(Map<String, String> map); static URL getKubernetesConfigurationUrl(Map<String, String> map); static URL findConfigResource(String resourceName); static URL asUrlOrResource(String s); static Map<String, String> parseMap(String s); @Override String getSessionId(); @Override String getNamespace(); @Override URL getMasterUrl(); @Override Map<String, String> getScriptEnvironmentVariables(); URL getEnvironmentSetupScriptUrl(); @Override URL getEnvironmentTeardownScriptUrl(); @Override URL getEnvironmentConfigUrl(); @Override List<URL> getEnvironmentDependencies(); @Override boolean isNamespaceLazyCreateEnabled(); @Override boolean isNamespaceCleanupEnabled(); @Override long getNamespaceCleanupTimeout(); @Override boolean isNamespaceCleanupConfirmationEnabled(); @Override boolean isNamespaceDestroyEnabled(); @Override boolean isNamespaceDestroyConfirmationEnabled(); @Override boolean isNamespaceUseCurrentEnabled(); @Override long getNamespaceDestroyTimeout(); @Override boolean isWaitEnabled(); @Override long getWaitTimeout(); @Override long getWaitPollInterval(); @Override List<String> getWaitForServiceList(); @Override boolean isAnsiLoggerEnabled(); @Override boolean isEnvironmentInitEnabled(); @Override boolean isLogCopyEnabled(); @Override String getLogPath(); @Override String getKubernetesDomain(); @Override String getDockerRegistry(); boolean hasBasicAuth(); String getUsername(); String getPassword(); @Override String getApiVersion(); @Override String getToken(); @Override boolean isTrustCerts(); @Override boolean isFmpBuildForMavenDisable(); @Override boolean isFmpDebugOutput(); @Override boolean isFmpLogsEnabled(); @Override boolean isFmpBuildEnabled(); @Override String getFmpPomPath(); @Override String getFmpBuildOptions(); @Override List<String> getFmpProfiles(); @Override List<String> getFmpSystemProperties(); @Override String toString();  }