Add config validator tests & Improve mkvtoolnix error logging & ConfigPathValidator

This commit is contained in:
2023-02-12 21:34:38 +01:00
parent 1d6098efc1
commit 51b4885e65
12 changed files with 239 additions and 59 deletions

View File

@@ -1,6 +1,8 @@
package at.pcgamingfreaks.mkvaudiosubtitlechanger.util;
import at.pcgamingfreaks.mkvaudiosubtitlechanger.config.ValidationResult;
import at.pcgamingfreaks.mkvaudiosubtitlechanger.model.ConfigProperty;
import org.junit.jupiter.params.provider.Arguments;
import java.util.Arrays;
@@ -13,4 +15,14 @@ public class TestUtil {
.collect(joining("\n", " - ", ""));
}
public static <T> Arguments argumentsOf(ConfigProperty property, boolean required, T defaultValue, String yaml, String[] cmd,
ValidationResult result) {
return Arguments.of(property, required, defaultValue, yaml, cmd, result);
}
public static Arguments argumentsOf(ConfigProperty property, boolean required, boolean append, String yaml, String[] cmd,
ValidationResult result, int expectedSize) {
return Arguments.of(property, required, append, yaml, cmd, result, expectedSize);
}
}