FunctionRunner { public static Context getContext(AbstractFunctionType<?> functionType) { return new Context(new Configuration(),functionType, new HashMap<>()); }  static Context getContext(AbstractFunctionType<?> functionType); static Context getContext(AbstractFunctionType<?> functionType, Map<String, String> properties); static Context getContext(Configuration configuration,AbstractFunctionType<?> functionType, Map<String, String> properties);  }
@Test public void test() throws IOException { TestFunction f = new TestFunction(); f.setId(new ObjectId()); Map<String, String> attributes = new HashMap<>(); attributes.put(AbstractOrganizableObject.NAME, "moustache"); f.setAttributes(attributes); try(Context context = FunctionRunner.getContext(new TestFunctionType())) { Output<JsonObject> o = context.run(f, "{}"); Assert.assertEquals("tache", o.getPayload().getString("mous")); } }