Skip to content

Commit

Permalink
Merge pull request #19641 from geoand/#19623
Browse files Browse the repository at this point in the history
Fix quarkus.test.arg-line multiple args handling
  • Loading branch information
geoand authored Aug 25, 2021
2 parents 36bf534 + 1982c8b commit 490c98d
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 490c98d

Please sign in to comment.