Skip to content

Commit

Permalink
Fix quarkus.test.arg-line multiple args handling
Browse files Browse the repository at this point in the history
The split is intended to happen on a whitespace character,
not the comma character used by properties

Fixes: quarkusio#19623
(cherry picked from commit 1982c8b)
  • Loading branch information
geoand authored and gsmet committed Aug 26, 2021
1 parent 3813c7a commit fee9cc8
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,22 @@ private ConfigUtil() {
}

public static List<String> argLineValue(Config config) {
List<String> 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<String> sanitizedString = new ArrayList<>(strings.size());
for (String s : strings) {
String[] parts = strValue.split("\\s+");
List<String> 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) {
Expand Down

0 comments on commit fee9cc8

Please sign in to comment.