AppendFunction extends BaseFEELFunction { public FEELFnResult<List<Object>> invoke( @ParameterName( "list" ) List list, @ParameterName( "item" ) Object[] items ) { return invoke((Object) list, items); } AppendFunction(); FEELFnResult<List<Object>> invoke( @ParameterName( "list" ) List list, @ParameterName( "item" ) Object[] items ); FEELFnResult<List<Object>> invoke( @ParameterName( "list" ) Object appendTo, @ParameterName( "item" ) Object[] items );  }
@Test public void invokeInvalidParams() { FunctionTestUtil.assertResultError(appendFunction.invoke((List) null, null), InvalidParametersEvent.class); FunctionTestUtil.assertResultError(appendFunction.invoke((List) null, new Object[]{}), InvalidParametersEvent.class); FunctionTestUtil.assertResultError(appendFunction.invoke(Collections.emptyList(), null), InvalidParametersEvent.class); }
@Test public void invokeEmptyParams() { FunctionTestUtil.assertResultList(appendFunction.invoke(Collections.emptyList(), new Object[]{}), Collections.emptyList()); }
@Test public void invokeAppendNothing() { FunctionTestUtil.assertResultList(appendFunction.invoke(Arrays.asList("test"), new Object[]{}), Arrays.asList("test")); FunctionTestUtil.assertResultList(appendFunction.invoke(Arrays.asList("test", "test2"), new Object[]{}), Arrays.asList("test", "test2")); }
@Test public void invokeAppendSomething() { FunctionTestUtil.assertResultList(appendFunction.invoke(Collections.emptyList(), new Object[]{"test"}), Arrays.asList("test")); FunctionTestUtil.assertResultList(appendFunction.invoke(Arrays.asList("test"), new Object[]{"test2"}), Arrays.asList("test", "test2")); FunctionTestUtil.assertResultList(appendFunction.invoke(Arrays.asList("test"), new Object[]{"test2", "test3"}), Arrays.asList("test", "test2", "test3")); }