final File treeJavascriptFile = new File(base, "tree.js");
FileUtils.write(treeJavascriptFile, "hello");
final Queue asyncCallback = mock(Queue.class);
final ScriptableObject globalScope = new NodeJsGlobal();
final ModuleScriptProvider moduleScriptProvider = mock(ModuleScriptProvider.class);
ModuleScript moduleScript = mock(ModuleScript.class);
when(moduleScript.getUri()).thenReturn(treeJavascriptFile.toURI());
when(moduleScript.getBase()).thenReturn(treeJavascriptFile.toURI());
when(moduleScript.getScript()).thenReturn(new Script() {
@Override
public Object exec(Context cx, Scriptable scope) {
return null;
}
});
when(moduleScriptProvider.getModuleScript(any(Context.class), eq(treeJavascriptFile.getAbsolutePath()),
any(URI.class), any(URI.class), any(Scriptable.class))).thenReturn(moduleScript);
final Script pre = mock(Script.class);
final Script post = mock(Script.class);
final ExitCallbackExecutor exitCallbackExecutor =
mock(ExitCallbackExecutor.class);