// Add CoreUtilConfigContributor behavior
expect(featureRegistry.getAllFeatureNames()).
andReturn(ImmutableSet.of("foo", "foo2", "core.util")).anyTimes();
replay(featureRegistry);
JsResponseBuilder builder = new JsResponseBuilder();
for (FeatureResource r : gadgetResources) {
if (r.isExternal()) {
builder.appendJs("<script src=\"" + r.getContent() + "\">", r.getName());
} else {
builder.appendJs(r.getContent(), r.getName());
}
}
reset(jsServingPipeline);
try {
expect(jsServingPipeline.execute(EasyMock.<JsRequest>anyObject())).andReturn(builder.build());
} catch (JsException e) {
throw new RuntimeException("Should not fail here");
}
replay(jsServingPipeline);
}