@Test public void invokesFunctionWithFluxOfSingleItem() { SpringCloudFunction fnWrapper = new SpringCloudFunction(x -> x, new SimpleFunctionInspector()); Object result = invoker.tryInvoke(fnWrapper, new Object[]{ "hello" }); assertThat(result).isInstanceOf(String.class); assertThat(result).isEqualTo("hello"); }
@Override public Optional<OutputEvent> tryInvoke(InvocationContext ctx, InputEvent evt) { SpringCloudMethod method = loader.getFunction(); Object[] userFunctionParams = coerceParameters(ctx, method, evt); Object result = tryInvoke(method, userFunctionParams); return coerceReturnValue(ctx, method, result); }
SpringCloudFunctionInvoker implements FunctionInvoker, Closeable { @Override public Optional<OutputEvent> tryInvoke(InvocationContext ctx, InputEvent evt) { SpringCloudMethod method = loader.getFunction(); Object[] userFunctionParams = coerceParameters(ctx, method, evt); Object result = tryInvoke(method, userFunctionParams); return coerceReturnValue(ctx, method, result); } }
SpringCloudFunctionInvoker implements FunctionInvoker, Closeable { @Override public Optional<OutputEvent> tryInvoke(InvocationContext ctx, InputEvent evt) { SpringCloudMethod method = loader.getFunction(); Object[] userFunctionParams = coerceParameters(ctx, method, evt); Object result = tryInvoke(method, userFunctionParams); return coerceReturnValue(ctx, method, result); } SpringCloudFunctionInvoker(SpringCloudFunctionLoader loader);  SpringCloudFunctionInvoker(Class<?> configClass); }
SpringCloudFunctionInvoker implements FunctionInvoker, Closeable { @Override public Optional<OutputEvent> tryInvoke(InvocationContext ctx, InputEvent evt) { SpringCloudMethod method = loader.getFunction(); Object[] userFunctionParams = coerceParameters(ctx, method, evt); Object result = tryInvoke(method, userFunctionParams); return coerceReturnValue(ctx, method, result); } SpringCloudFunctionInvoker(SpringCloudFunctionLoader loader);  SpringCloudFunctionInvoker(Class<?> configClass); @Override Optional<OutputEvent> tryInvoke(InvocationContext ctx, InputEvent evt); @Override void close(); }
SpringCloudFunctionInvoker implements FunctionInvoker, Closeable { @Override public Optional<OutputEvent> tryInvoke(InvocationContext ctx, InputEvent evt) { SpringCloudMethod method = loader.getFunction(); Object[] userFunctionParams = coerceParameters(ctx, method, evt); Object result = tryInvoke(method, userFunctionParams); return coerceReturnValue(ctx, method, result); } SpringCloudFunctionInvoker(SpringCloudFunctionLoader loader);  SpringCloudFunctionInvoker(Class<?> configClass); @Override Optional<OutputEvent> tryInvoke(InvocationContext ctx, InputEvent evt); @Override void close();  }