@Test
public void testRevocationHelper() throws Exception {

  String fileStoragePrefix = null;
  if (new File("target").exists()) {
    fileStoragePrefix = "target/revocation-test/";
  } else {
    fileStoragePrefix = "service-helper/target/revocation-test/";
  }
  //
  IssuanceHelper.initInstance(1024, fileStoragePrefix, fileStoragePrefix,
      new SpecAndPolicy[] {universityIdemix}, new ArrayList<RevocationAuthorityParameters>());
  //
  URI revocationInfoReference =
      URI.create("http://localhost:9094/integration-test-revocation/revocation/getrevocationinformation");
  URI nonRevocationEvidenceReference =
      URI.create("http://localhost:9094/integration-test-revocation/revocation/generatenonrevocationevidence");
  URI nonRevocationUpdateReference =
      URI.create("http://localhost:9094/integration-test-revocation/revocation/generatenonrevocationevidenceupdate");;
  RevocationReferences revocationReferences =
      new RevocationReferences(patrasRevocationAuthority, revocationInfoReference,
          nonRevocationEvidenceReference, nonRevocationUpdateReference);
  String systemParametersResource = fileStoragePrefix + RevocationHelper.SYSTEM_PARAMS_XML_NAME;
  SystemParameters systemParameters = FileSystem.loadXmlFromResource(systemParametersResource);
  List<IssuerParameters> issuerParamsList =
      FileSystem.findAndLoadXmlResourcesInDir(fileStoragePrefix, "issuer_params");
  String[] credSpecResourceList =
      {"/eu/abc4trust/sampleXml/patras/credentialSpecificationPatrasUniversityWithRevocation.xml"};
  List<CredentialSpecification> credSpecList =
      FileSystem.loadXmlListFromResources(credSpecResourceList);
  System.out.println("=============================================");
  RevocationHelper.initInstance(fileStoragePrefix, fileStoragePrefix, systemParameters,
      issuerParamsList, credSpecList, revocationReferences);
  String[] revocationAuthorityParameters_resources =
      FileSystem.findFilesInDir(fileStoragePrefix, "revocation_authority");
  System.out.println("revocationAuthorityParameters_resources : "
      + revocationAuthorityParameters_resources);
  System.out.println("revocationAuthorityParameters_resources : "
      + revocationAuthorityParameters_resources[0]);
  RevocationAuthorityParameters revocationAuthorityParameters =
      (RevocationAuthorityParameters) FileSystem
          .loadXmlFromResource(revocationAuthorityParameters_resources[0]);
  // Assert.assertNotNull("Version should be specified",
  // revocationAuthorityParameters.getVersion());
  // Assert.assertNotSame("Version cannot be empty", revocationAuthorityParameters.getVersion(),
  // "");
  Assert.assertNotNull("RevocationInfoReference - should have been assigned",
      revocationAuthorityParameters.getRevocationInfoReference());
  Assert.assertNotNull("NonRevocationEvidenceReference - should have been  assigned",
      revocationAuthorityParameters.getNonRevocationEvidenceReference());
  Assert.assertNotNull("RevocationEvidenceUpdateReference - should have been  assigned",
      revocationAuthorityParameters.getNonRevocationEvidenceUpdateReference());
  System.out.println("revocationAuthorityParameters_resources : "
      + XmlUtils.toXml(of.createRevocationAuthorityParameters(revocationAuthorityParameters),
          false));
  System.out.println("revocationAuthorityParameters_resources : "
      + XmlUtils.toXml(of.createRevocationAuthorityParameters(revocationAuthorityParameters),
          true));
}