### Question:
DefaultJsUriManager implements JsUriManager { public Uri makeExternJsUri(JsUri ctx) { String container = ctx.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(ctx.getLibs())); if (!ctx.getLoadedLibs().isEmpty()) { jsPath.append('!').append(addJsLibs(ctx.getLoadedLibs())); } jsPath.append(JS_SUFFIX); uri.setPath(jsPath.toString()); uri.addQueryParameter(Param.CONTAINER.getKey(), container); uri.addQueryParameter(Param.NO_CACHE.getKey(), ctx.isNoCache() ? "1" : "0"); uri.addQueryParameter(Param.DEBUG.getKey(), ctx.isDebug() ? "1" : "0"); uri.addQueryParameter(Param.CONTAINER_MODE.getKey(), ctx.getContext().getParamValue()); if (addGadgetUri()) { uri.addQueryParameter(Param.URL.getKey(), ctx.getGadget()); } if (ctx.getOnload() != null) { uri.addQueryParameter(Param.ONLOAD.getKey(), ctx.getOnload()); } if (ctx.isJsload()) { uri.addQueryParameter(Param.JSLOAD.getKey(), "1"); } if (ctx.isNohint()) { uri.addQueryParameter(Param.NO_HINT.getKey(), "1"); } JsCompileMode mode = ctx.getCompileMode(); if (mode != null && mode != JsCompileMode.getDefault()) { uri.addQueryParameter(Param.COMPILE_MODE.getKey(), mode.getParamValue()); } if (ctx.cajoleContent()) { uri.addQueryParameter(Param.CAJOLE.getKey(), "1"); } if (ctx.getRepository() != null) { uri.addQueryParameter(Param.REPOSITORY_ID.getKey(), ctx.getRepository()); } if (versioner != null && !ctx.isNoCache()) { String version = versioner.version(ctx); if (version != null && version.length() > 0) { uri.addQueryParameter(Param.VERSION.getKey(), version); } } if (ctx.getExtensionParams() != null) { uri.addQueryParameters(ctx.getExtensionParams()); } return uri.toUri(); } @Inject  DefaultJsUriManager(ContainerConfig config, Versioner versioner); @Inject(optional = true) void setAuthority(Authority authority); Uri makeExternJsUri(JsUri ctx); JsUri processExternJsUri(Uri uri);  }### Answer:
@Test(expected = RuntimeException.class) public void makeMissingHostConfig() { ContainerConfig config = mockConfig(null, "/gadgets/js"); DefaultJsUriManager manager = makeManager(config, null); JsUri ctx = mockGadgetContext(false, false, null); manager.makeExternJsUri(ctx); }
@Test(expected = RuntimeException.class) public void makeMissingPathConfig() { ContainerConfig config = mockConfig("foo", null); DefaultJsUriManager manager = makeManager(config, null); JsUri ctx = mockGadgetContext(false, false, null); manager.makeExternJsUri(ctx); }