diff --git a/test-framework/junit5/src/main/java/io/quarkus/test/junit/launcher/ConfigUtil.java b/test-framework/junit5/src/main/java/io/quarkus/test/junit/launcher/ConfigUtil.java index 97ed503bea78b..143c160eb4e02 100644 --- a/test-framework/junit5/src/main/java/io/quarkus/test/junit/launcher/ConfigUtil.java +++ b/test-framework/junit5/src/main/java/io/quarkus/test/junit/launcher/ConfigUtil.java @@ -16,21 +16,22 @@ private ConfigUtil() { } public static List argLineValue(Config config) { - List strings = config.getOptionalValues("quarkus.test.arg-line", String.class) - .orElse(config.getOptionalValues("quarkus.test.argLine", String.class) // legacy value - .orElse(Collections.emptyList())); - if (strings.isEmpty()) { - return strings; + String strValue = config.getOptionalValue("quarkus.test.arg-line", String.class) + .orElse(config.getOptionalValue("quarkus.test.argLine", String.class) // legacy value + .orElse(null)); + if (strValue == null) { + return Collections.emptyList(); } - List sanitizedString = new ArrayList<>(strings.size()); - for (String s : strings) { + String[] parts = strValue.split("\\s+"); + List result = new ArrayList<>(parts.length); + for (String s : parts) { String trimmed = s.trim(); if (trimmed.isEmpty()) { continue; } - sanitizedString.add(trimmed); + result.add(trimmed); } - return sanitizedString; + return result; } public static Duration waitTimeValue(Config config) {