Element e1 = elem("script", "src", scriptSrc);
Element e2 = elem("script", "src", "^!,,|BLARGH");
Element e3 = elem("IMG", "src", imgSrc);
Element e4 = elem("script", "src", " " + scriptSrc + " ");
List<Node> nodes = ImmutableList.<Node>of(e1, e2, e3, e4);
ProxyUriManager uriManager = createMock(ProxyUriManager.class);
Uri rewrittenUri = Uri.parse("http://bar.com/");
List<Uri> returned = Lists.newArrayList(rewrittenUri, rewrittenUri, rewrittenUri);
ContentRewriterFeature.Config config = createMock(ContentRewriterFeature.Config.class);
Integer expires = 3;
expect(config.getExpires()).andReturn(expires).once();
expect(config);
Capture<List<ProxyUriManager.ProxyUri>> cap = new Capture<List<ProxyUriManager.ProxyUri>>();
Capture<Integer> intCap = new Capture<Integer>();
expect(uriManager.make(capture(cap), capture(intCap))).andReturn(returned).once();
replay(config, uriManager);
Gadget gadget = gadget();
ProxyingVisitor rewriter = new ProxyingVisitor(config, uriManager,
ProxyingVisitor.Tags.SCRIPT,