BackendServiceImpl extends RemoteServiceServlet implements BackendService { static Document fixRootNode(Document samlToken) throws org.jdom2.JDOMException { DOMBuilder builder = new DOMBuilder(); org.jdom2.Document jDomDoc = builder.build(samlToken); Element assertionElement = jDomDoc.getRootElement().getChildren().get(0); jDomDoc.detachRootElement(); assertionElement.detach(); jDomDoc.setRootElement(assertionElement); DOMOutputter outputter = new DOMOutputter(); return outputter.output(jDomDoc); }  @Override void init(); @Override void destroy(); @Override DtoRegion[] loadRegions(String filter); @Override void storeRegions(DtoRegion[] regions); @Override DtoProductSet[] getProductSets(String filter); @Override DtoProcessorDescriptor[] getProcessors(String filterString); @Override DtoAggregatorDescriptor[] getAggregators(String filterString); @Override DtoMaskDescriptor[] getMasks(); @Override DtoProduction[] getProductions(String filter); @Override DtoProductionRequest getProductionRequest(String productionId); @Override DtoProductionResponse orderProduction(DtoProductionRequest dtoProductionRequest); @Override void saveRequest(DtoProductionRequest dtoProductionRequest); @Override void deleteRequest(String requestId); @Override DtoProductionRequest[] listRequests(); @Override void cancelProductions(String[] productionIds); @Override void deleteProductions(String[] productionIds); @Override void stageProductions(String[] productionIds); @Override void scpProduction(final String productionId, final String remotePath); @Override String[] listUserFiles(String dirPath); @Override String[] listSystemFiles(String dirPath); @Override boolean removeUserFile(String filePath); @Override boolean removeUserFiles(String... filePaths); @Override boolean removeUserDirectory(String filePath); @Override String checkUserRecordSource(String filePath); @Override float[] listUserRecordSource(String filePath); @Override DtoCalvalusConfig getCalvalusConfig(); @Override String[][] calculateL3Periods(String minDate, String maxDate, String steppingPeriodLength, String compositingPeriodLength); @Override DtoRegionDataInfo loadRegionDataInfo(String filePath); static final String VERSION; static final String COPYRIGHT_YEAR; }
@Test public void testFixRootNode() throws Exception { Document document = parseXml(originalSamlToken); document = fixRootNode(document); assertNotNull(document); assertEquals("saml2:Assertion", document.getFirstChild().getNodeName()); }