@Test public void testValidationWhenVariableNameIsReservedKeyword() { assertThat(FEELSyntaxLightValidator.isVariableNameValid("for")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("return")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("if")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("then")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("else")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("some")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("every")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("satisfies")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("instance")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("of")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("in")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("function")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("external")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("or")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("and")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("between")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("not")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("null")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("true")).isFalse(); assertThat(FEELSyntaxLightValidator.isVariableNameValid("false")).isFalse(); }
public static boolean isVariableNameValid(final String variableName) { return notEmpty(variableName) && firstCharacterIsValid(variableName) && firstWordIsNotReservedKeyword(variableName) && doesNotContainForbiddenChars(variableName); }
FEELSyntaxLightValidator { public static boolean isVariableNameValid(final String variableName) { return notEmpty(variableName) && firstCharacterIsValid(variableName) && firstWordIsNotReservedKeyword(variableName) && doesNotContainForbiddenChars(variableName); } }
FEELSyntaxLightValidator { public static boolean isVariableNameValid(final String variableName) { return notEmpty(variableName) && firstCharacterIsValid(variableName) && firstWordIsNotReservedKeyword(variableName) && doesNotContainForbiddenChars(variableName); }  }
FEELSyntaxLightValidator { public static boolean isVariableNameValid(final String variableName) { return notEmpty(variableName) && firstCharacterIsValid(variableName) && firstWordIsNotReservedKeyword(variableName) && doesNotContainForbiddenChars(variableName); }  static boolean isVariableNameValid(final String variableName); }
FEELSyntaxLightValidator { public static boolean isVariableNameValid(final String variableName) { return notEmpty(variableName) && firstCharacterIsValid(variableName) && firstWordIsNotReservedKeyword(variableName) && doesNotContainForbiddenChars(variableName); }  static boolean isVariableNameValid(final String variableName);  }