### Question:
ScriptExecutor { public Object execute(TaskScript taskScript, ExecutionContext context) { Option<ScriptEngine> scriptEngine = getScriptEngine(taskScript.getLanguage()); if (scriptEngine.isPresent()) { return evalScript(taskScript, scriptEngine.get(), context); } else { throw new UnsupportedOperationException("could not find a script engine for " + taskScript.getLanguage()); } } ScriptExecutor(ScriptEngineManager manager); Object execute(TaskScript taskScript, ExecutionContext context); Option<ScriptEngine> getScriptEngine(String language);  }### Answer:
@Test public void shouldExecuteScript() { TaskScript taskJavaScript = new TaskScript("JavaScript", testScript()); ExecutionContext executionContext = testContext(); new ScriptExecutor(new ScriptEngineManager()).execute(taskJavaScript, executionContext); verify(testService).echo("js"); NumberProperty<?> barProperty = (NumberProperty<?>) executionContext.getProperties().get("bar"); assertThat(barProperty.getValue().intValue()).isEqualTo(2); }