RevealedAttrsAndFactsdDescrGenerator { public static RevealedFactsAndAttributeValues generateFriendlyDesciptions(PresentationTokenDescription ptd, Map<URI,CredentialSpecification> credSpecs){ PolicyTranslator pt = new PolicyTranslator(ptd, getAliasCredSpecList(ptd,credSpecs)); RevealedFactsAndAttributeValues ret = composeFriendlyDescOfRevealedFactsAndAttributeValues(pt, null); return ret; }  static RevealedFactsAndAttributeValues generateFriendlyDesciptions(PresentationTokenDescription ptd, 
			Map<URI,CredentialSpecification> credSpecs); static RevealedFactsAndAttributeValues generateFriendlyDesciptions(PresentationTokenDescription ptd, 
			Map<URI,CredentialSpecification> credSpecs, Map<URI,IssuerParameters> isParams);  }
@Test public void testFriendlyTokenDescriptionGenerator() throws Exception { Map<URI,CredentialSpecification> uriCredspecs = new HashMap<URI, CredentialSpecification>(); CredentialSpecification creditCardSpec = (CredentialSpecification) XmlUtils.getObjectFromXML(this.getClass().getResourceAsStream( "/eu/abc4trust/sampleXml/credspecs/credentialSpecificationCreditcardVisaForFriendlyGenTest.xml"), true); if (creditCardSpec !=null){ uriCredspecs.put(creditCardSpec.getSpecificationUID(), creditCardSpec); } CredentialSpecification passportSpec = (CredentialSpecification) XmlUtils.getObjectFromXML(this.getClass().getResourceAsStream( "/eu/abc4trust/sampleXml/credspecs/credentialSpecificationPassport.xml"), true); if (passportSpec !=null){ uriCredspecs.put(passportSpec.getSpecificationUID(), passportSpec); } PresentationToken ptCard = (PresentationToken) XmlUtils.getObjectFromXML(this.getClass().getResourceAsStream( "/eu/abc4trust/sampleXml/presentationTokens/presentationTokenCreditCardForFriendlyGenTest.xml"), true); PresentationToken ptHotel = (PresentationToken) XmlUtils.getObjectFromXML(this.getClass().getResourceAsStream( "/eu/abc4trust/sampleXml/presentationTokens/presentationTokenHotelOption1.xml"), true); RevealedFactsAndAttributeValues rvs = RevealedAttrsAndFactsdDescrGenerator.generateFriendlyDesciptions(ptCard.getPresentationTokenDescription(),uriCredspecs); printRevealedAttributes(rvs, new String[][] { { "en: The value of Card Type from Visa Credit Card: gold" } , {"sv: Värdet av Status från INGEN VÄNLIG BESKRIVNING: 123123" , "en: The value of Status from Visa Credit Card: 123123" } }); printRevealedFacts(rvs , new String[][] { { "sv: Värdet av Utgångsdatum från INGEN VÄNLIG BESKRIVNING är efter eller lika med 06.01.2012 01:00" ,"en: The value of Expiration Date from Visa Credit Card is after or on 06.01.2012 01:00" } ,{"sv: Värdet av Utgångsdatum från INGEN VÄNLIG BESKRIVNING är före eller lika med 06.01.2014 01:00" , "en: The value of Expiration Date from Visa Credit Card is before or on 06.01.2014 01:00" }}); RevealedFactsAndAttributeValues rvs2 = RevealedAttrsAndFactsdDescrGenerator.generateFriendlyDesciptions(ptHotel.getPresentationTokenDescription(), uriCredspecs); printRevealedAttributes(rvs2, new String[][] {{}, {}}); printRevealedFacts(rvs2, new String[][] { { "sv: Värdet av Utgångsdatum från INGEN VÄNLIG BESKRIVNING är efter eller lika med 06.01.2012", "en: The value of Expiration Date from Visa Credit Card is after or on 06.01.2012" } }); }