### Question:
PipelineDataGadgetRewriter implements GadgetRewriter { Map<PipelinedData, Node> parsePipelinedData(Gadget gadget, Document doc) { List<Element> dataTags = SocialDataTags.getTags(doc, SocialDataTags.OSML_DATA_TAG); Map<PipelinedData, Node> pipelineNodes = Maps.newHashMap(); for (Element n : dataTags) { try { PipelinedData pipelineData = new PipelinedData(n, gadget.getSpec().getUrl()); pipelineNodes.put(pipelineData, n); } catch (SpecParserException e) { if (LOG.isLoggable(Level.INFO)) { LOG.logp(Level.INFO, classname, "parsePipelinedData", MessageKeys.FAILED_TO_PARSE_PRELOAD, new Object[] {gadget.getSpec().getUrl()}); LOG.log(Level.INFO, e.getMessage(), e); } } } return pipelineNodes; } @Inject  PipelineDataGadgetRewriter(PipelineExecutor executor); void rewrite(Gadget gadget, MutableContent content);  }### Answer:
@Test public void parseOfDataRequest() throws Exception { final String contentWithDataRequest = "<script xmlns:os=\"http: + " <os:DataRequest key=\"me\" method=\"people.get\" userId=\"canonical\"/>" + "</script>"; setupGadget(getGadgetXml(contentWithDataRequest)); Map<PipelinedData, ? extends Object> pipelines = rewriter.parsePipelinedData(gadget, content.getDocument()); assertEquals(1, pipelines.size()); PipelinedData pipeline = pipelines.keySet().iterator().next(); PipelinedData.Batch batch = pipeline.getBatch(Expressions.forTesting(), new RootELResolver()); Map<String, PipelinedData.BatchItem> preloads = batch.getPreloads(); assertTrue(preloads.containsKey("me")); assertEquals(PipelinedData.BatchType.SOCIAL, preloads.get("me").getType()); JsonAssert.assertObjectEquals( "{params: {userId: 'canonical'}, method: 'people.get', id: 'me'}", preloads.get("me").getData()); }