@Test void invalidExpressions_areRejected() { assertThrows(IllegalArgumentException.class, () -> Expressions.create("abc")); }
public static Expression create(String expressionSpec) { Matcher matcher = EXPRESSION_PATTERN.matcher(expressionSpec); if (matcher.matches()) { String operator = matcher.group(1); String spec = matcher.group(2); if (StringUtils.isNotEmpty(spec)) { return create(operator, Arrays.asList(spec.split(MULTIPLE_VALUE_DELIMITER))); } else { throw new IllegalArgumentException("Supplied expression: " + expressionSpec + " is not valid. Please see RFC 6570 for more information how to construct an " + "expression"); } } else { throw new IllegalArgumentException("Supplied expression: " + expressionSpec + " is not valid. Please see RFC 6570 for more information how to construct an " + "expression"); } }
Expressions { public static Expression create(String expressionSpec) { Matcher matcher = EXPRESSION_PATTERN.matcher(expressionSpec); if (matcher.matches()) { String operator = matcher.group(1); String spec = matcher.group(2); if (StringUtils.isNotEmpty(spec)) { return create(operator, Arrays.asList(spec.split(MULTIPLE_VALUE_DELIMITER))); } else { throw new IllegalArgumentException("Supplied expression: " + expressionSpec + " is not valid. Please see RFC 6570 for more information how to construct an " + "expression"); } } else { throw new IllegalArgumentException("Supplied expression: " + expressionSpec + " is not valid. Please see RFC 6570 for more information how to construct an " + "expression"); } } }
Expressions { public static Expression create(String expressionSpec) { Matcher matcher = EXPRESSION_PATTERN.matcher(expressionSpec); if (matcher.matches()) { String operator = matcher.group(1); String spec = matcher.group(2); if (StringUtils.isNotEmpty(spec)) { return create(operator, Arrays.asList(spec.split(MULTIPLE_VALUE_DELIMITER))); } else { throw new IllegalArgumentException("Supplied expression: " + expressionSpec + " is not valid. Please see RFC 6570 for more information how to construct an " + "expression"); } } else { throw new IllegalArgumentException("Supplied expression: " + expressionSpec + " is not valid. Please see RFC 6570 for more information how to construct an " + "expression"); } }  }
Expressions { public static Expression create(String expressionSpec) { Matcher matcher = EXPRESSION_PATTERN.matcher(expressionSpec); if (matcher.matches()) { String operator = matcher.group(1); String spec = matcher.group(2); if (StringUtils.isNotEmpty(spec)) { return create(operator, Arrays.asList(spec.split(MULTIPLE_VALUE_DELIMITER))); } else { throw new IllegalArgumentException("Supplied expression: " + expressionSpec + " is not valid. Please see RFC 6570 for more information how to construct an " + "expression"); } } else { throw new IllegalArgumentException("Supplied expression: " + expressionSpec + " is not valid. Please see RFC 6570 for more information how to construct an " + "expression"); } }  static Expression create(String expressionSpec); }
Expressions { public static Expression create(String expressionSpec) { Matcher matcher = EXPRESSION_PATTERN.matcher(expressionSpec); if (matcher.matches()) { String operator = matcher.group(1); String spec = matcher.group(2); if (StringUtils.isNotEmpty(spec)) { return create(operator, Arrays.asList(spec.split(MULTIPLE_VALUE_DELIMITER))); } else { throw new IllegalArgumentException("Supplied expression: " + expressionSpec + " is not valid. Please see RFC 6570 for more information how to construct an " + "expression"); } } else { throw new IllegalArgumentException("Supplied expression: " + expressionSpec + " is not valid. Please see RFC 6570 for more information how to construct an " + "expression"); } }  static Expression create(String expressionSpec);  }