### Question:
ScriptingManager { public static CompletableFuture<Void> runScript(File file, Wot wot) { Path path = file.toPath(); try { String script = Files.readString(path); String extension = pathToExtension(path); String mediaType = extensionToMediaType(extension); if (mediaType == null) { return failedFuture(new ScriptingManagerException("No scripting engine available for extension '" + extension + "'")); } return runScript(script, mediaType, wot); } catch (IOException e) { return failedFuture(new ScriptingManagerException(e)); } } private  ScriptingManager(); static void addEngine(ScriptingEngine engine); static void removeEngine(String extension); static CompletableFuture<Void> runScript(File file, Wot wot); static CompletableFuture<Void> runScript(String script, String mediaType, Wot wot); static CompletableFuture<Void> runPrivilegedScript(File file, Wot wot); static CompletableFuture<Void> runPrivilegedScript(String script,
                                                              String mediaType,
                                                              Wot wot);  }### Answer:
@Test public void runScript() throws IOException { TemporaryFolder folder = new TemporaryFolder(); folder.create(); File file = folder.newFile("counter.test"); Files.write("1+1", file, Charset.defaultCharset()); ScriptingManager.runScript(file, null); assertTrue(true); }
@Test public void runScriptString() throws ExecutionException, InterruptedException { ScriptingManager.runScript("1+1", "application/test", null).get(); assertTrue(true); }
@Test(expected = ScriptingException.class) public void runScriptUnsupportedMediaType() throws Throwable { try { ScriptingManager.runScript("1+1", "application/lolcode", null).get(); } catch (InterruptedException | ExecutionException e) { throw e.getCause(); } }