XdsbMetadataGeneratorImpl implements XdsbMetadataGenerator { @Override public String generateMetadataXml(String document, String homeCommunityId, String patientUniqueId, String entryUUID) { final String xslUrl = Thread.currentThread().getContextClassLoader() .getResource(resolveXslFileName(documentTypeForXdsbMetadata)) .toString(); final String xdsDocumentEntryUniqueId = uniqueOidProvider.getOid(); final String xdsSubmissionSetUniqueId = uniqueOidProvider.getOid(); final Params params = ParamsBuilder.withParam( XdsDocumentEntry_UniqueId_Parameter_Name, xdsDocumentEntryUniqueId).and( XdsSubmissionSet_UniqueId_Parameter_Name, xdsSubmissionSetUniqueId); addIfValueHasText(params, HomeCommunityId_Parameter_Name, homeCommunityId); addIfValueHasText(params, XdsDocumentEntry_EntryUUID_Parameter_Name, entryUUID); addIfValueHasText(params, PatientUniqueId_Parameter_Name, patientUniqueId); assertDeprecatePrivacyPolicyConditions(params); final String metadataXml = xmlTransformer.transform(document, xslUrl, Optional.of(params), Optional.empty()); logger.debug("metadataXml:"); logger.debug(metadataXml); return metadataXml; } XdsbMetadataGeneratorImpl(UniqueOidProvider uniqueOidProvider,
			XdsbDocumentType documentTypeForXdsbMetadata,
			SimpleMarshaller marshaller, XmlTransformer xmlTransformer);  XdsbMetadataGeneratorImpl(
			XdsbDocumentType documentTypeForXdsbMetadata); @Override SubmitObjectsRequest generateMetadata(String document,
			String homeCommunityId, String patientUniqueId, String entryUUID); @Override String generateMetadataXml(String document, String homeCommunityId,
			String patientUniqueId, String entryUUID);  }
@Test public void printSpiritMetadata() throws IOException, SAXException { initSpiritPrivacy(); final String policy = fileReader.readFile("XacmlConsentSample.xml"); final String expectedMetadata = fileReader .readFile("XacmlConsentSampleResult.xml"); final String actualMetadata = sut.generateMetadataXml(policy, "haha", null, null); final DetailedDiff diff = XmlComparator.compareXMLs(expectedMetadata, actualMetadata, createIgnoreTime()); assertTrue(diff.similar()); }