Added invalid type test

This commit is contained in:
Xavi Aracil
2022-11-25 14:27:44 +01:00
parent 5cb232ea5b
commit 521cce5dd4
4 changed files with 43 additions and 13 deletions
@@ -33,8 +33,7 @@ public class TypePropertyProbe extends PropertyProbe {
List<String> allowedValues = expected.getAllowedTypeValues();
if (allowedValues.isEmpty()) {
// TODO implement
throw new IllegalStateException();
return fatal("The type property is invalid", ctx);
}
if (!values.stream().anyMatch(v -> allowedValues.contains(v))) {
return fatal(formatMessage(values), ctx);