@Test public void testUnitLazyVarBinding() { ExecutableBuilder f = ExecutableBuilder.create(); DataSource<Person> people = DataSource.create( new Person("Mario", 10), new Person("Daniele", 30), new Person("Mark", 90)); f.newApplicationContext("app1") .getKieContainer(releaseIdUnit) .newRuleUnitExecutor() .run((() -> new AdultUnitDifferentDataSourceName(people))) .getGlobal("oldName") .set("test") .bindVariableByExpression("lazyVariable", context -> context.get("test")) .get("lazyVariable") .out("firedRules") .dispose(); RequestContext requestContext = ExecutableRunner.create().execute(f.getExecutable()); assertEquals("Mark", requestContext.getOutputs().get("firedRules")); }