### Question:
DefaultJsUriManager implements JsUriManager { public Uri makeExternJsUri(Gadget gadget, Collection<String> extern) { String container = gadget.getContext().getContainer(); String jsHost = getReqConfig(container, JS_HOST_PARAM); String jsPathBase = getReqConfig(container, JS_PATH_PARAM); UriBuilder uri = new UriBuilder(Uri.parse(jsHost)); StringBuilder jsPath = new StringBuilder(jsPathBase); if (!jsPathBase.endsWith("/")) { jsPath.append('/'); } jsPath.append(addJsLibs(extern)); jsPath.append(JS_SUFFIX); uri.setPath(jsPath.toString()); uri.addQueryParameter(Param.CONTAINER.getKey(), container); uri.addQueryParameter(Param.NO_CACHE.getKey(), gadget.getContext().getIgnoreCache() ? "1" : "0"); uri.addQueryParameter(Param.DEBUG.getKey(), gadget.getContext().getDebug() ? "1" : "0"); uri.addQueryParameter(Param.CONTAINER_MODE.getKey(), gadget.getContext().getRenderingContext() == RenderingContext.CONTAINER ? "1" : "0"); if (addGadgetUri()) { uri.addQueryParameter(Param.URL.getKey(), gadget.getSpec().getUrl().toString()); } if (versioner != null && !gadget.getContext().getIgnoreCache()) { uri.addQueryParameter(Param.VERSION.getKey(), versioner.version(gadget.getContext().getUrl(), container, extern)); } return uri.toUri(); } @Inject  DefaultJsUriManager(ContainerConfig config,
                             Versioner versioner); Uri makeExternJsUri(Gadget gadget, Collection<String> extern); JsUri processExternJsUri(Uri uri);  }### Answer:
@Test(expected = RuntimeException.class) public void makeMissingHostConfig() { ContainerConfig config = mockConfig(null, "/gadgets/js"); DefaultJsUriManager manager = makeManager(config, null); Gadget gadget = mockGadget(false, false); manager.makeExternJsUri(gadget, null); }
@Test(expected = RuntimeException.class) public void makeMissingPathConfig() { ContainerConfig config = mockConfig("foo", null); DefaultJsUriManager manager = makeManager(config, null); Gadget gadget = mockGadget(false, false); manager.makeExternJsUri(gadget, null); }