String targetHost = "target-host.org";
ContainerConfig config = mockConfig("http://" + targetHost, "/gadgets/js");
List<String> extern = Lists.newArrayList("feature", "another");
String version = "verstring";
String badVersion = version + "-a";
JsUri ctx = mockGadgetContext(false, false, extern);
Versioner versioner = mockVersioner(ctx, version, badVersion);
TestDefaultJsUriManager manager = makeManager(config, versioner);
Uri testUri = Uri.parse("http://target-host.org/gadgets/js/" + addJsLibs(extern) +
JS_SUFFIX + '?' + Param.CONTAINER.getKey() + '=' + CONTAINER + '&' +
Param.VERSION.getKey() + '=' + badVersion);
JsUri jsUri = manager.processExternJsUri(testUri);
assertFalse(manager.hadError());
assertEquals(jsUri.getStatus(), UriStatus.INVALID_VERSION);
assertCollectionEquals(jsUri.getLibs(), extern);
}