StringLowerCaseFunction extends BaseFEELFunction { public FEELFnResult<String> invoke(@ParameterName("string") String string) { if ( string == null ) { return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "string", "cannot be null")); } else { return FEELFnResult.ofResult( string.toLowerCase() ); } } StringLowerCaseFunction(); FEELFnResult<String> invoke(@ParameterName("string") String string);  }
@Test public void invokeNull() { FunctionTestUtil.assertResultError(stringLowerCaseFunction.invoke(null), InvalidParametersEvent.class); }
@Test public void invokeLowercaseString() { FunctionTestUtil.assertResult(stringLowerCaseFunction.invoke("teststring"), "teststring"); }
@Test public void invokeUppercaseString() { FunctionTestUtil.assertResult(stringLowerCaseFunction.invoke("TESTSTRING"), "teststring"); }
@Test public void invokeMixedCaseString() { FunctionTestUtil.assertResult(stringLowerCaseFunction.invoke("testSTRing"), "teststring"); }