Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix quarkus.test.arg-line multiple args handling #19641

Merged
merged 1 commit into from
Aug 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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