1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-25 21:42:07 +01:00

[sinttest] Reject empty string values for enabled/disabled tests configuration

This commit is contained in:
Florian Schmaus 2024-10-18 15:44:51 +02:00
parent 18647c24ca
commit d7858d2e8f

View file

@ -392,12 +392,12 @@ public final class Configuration {
} }
public Builder setEnabledTests(String enabledTestsString) { public Builder setEnabledTests(String enabledTestsString) {
enabledTests = getTestSetFrom(enabledTestsString); enabledTests = getTestSetFrom(enabledTestsString, "enabled");
return this; return this;
} }
public Builder setDisabledTests(String disabledTestsString) { public Builder setDisabledTests(String disabledTestsString) {
disabledTests = getTestSetFrom(disabledTestsString); disabledTests = getTestSetFrom(disabledTestsString, "disabled");
return this; return this;
} }
@ -625,7 +625,8 @@ public final class Configuration {
return res; return res;
} }
private static Set<String> getTestSetFrom(String input) { private static Set<String> getTestSetFrom(String input, String name) {
StringUtils.requireNullOrNotEmpty(input, "Most provide a value for " + name + " tests");
return split(input, s -> { return split(input, s -> {
s = s.trim(); s = s.trim();
if (s.startsWith("smackx.") || s.startsWith("smack.")) { if (s.startsWith("smackx.") || s.startsWith("smack.")) {