@Test
public void requestFromXMLfile() throws IOException, CertificateException, XMLParserException,
  UnmarshallingException, ErrorCodeException, InitializationException, ComponentInitializationException
{

  String issuer = "https://test/";
  String destination = "test destination";
  String providerName = "test providername";
  Map<EidasPersonAttributes, Boolean> requestedAttributes = new HashMap<>();
  requestedAttributes.put(EidasNaturalPersonAttributes.BIRTH_NAME, true);
  requestedAttributes.put(EidasNaturalPersonAttributes.CURRENT_ADDRESS, false);
  requestedAttributes.put(EidasNaturalPersonAttributes.DATE_OF_BIRTH, true);
  requestedAttributes.put(EidasNaturalPersonAttributes.FAMILY_NAME, false);
  requestedAttributes.put(EidasNaturalPersonAttributes.FIRST_NAME, true);
  requestedAttributes.put(EidasNaturalPersonAttributes.GENDER, true);
  requestedAttributes.put(EidasNaturalPersonAttributes.PERSON_IDENTIFIER, true);
  requestedAttributes.put(EidasNaturalPersonAttributes.PLACE_OF_BIRTH, false);
  requestedAttributes.put(EidasLegalPersonAttributes.LEGAL_PERSON_IDENTIFIER, true);
  requestedAttributes.put(EidasLegalPersonAttributes.LEGAL_NAME, true);
  requestedAttributes.put(EidasLegalPersonAttributes.LEGAL_ADDRESS, true);
  requestedAttributes.put(EidasLegalPersonAttributes.VAT_REGISTRATION, true);
  requestedAttributes.put(EidasLegalPersonAttributes.TAX_REFERENCE, true);
  requestedAttributes.put(EidasLegalPersonAttributes.D2012_17_EU_IDENTIFIER, true);
  requestedAttributes.put(EidasLegalPersonAttributes.LEI, true);
  requestedAttributes.put(EidasLegalPersonAttributes.EORI, true);
  requestedAttributes.put(EidasLegalPersonAttributes.SEED, true);
  requestedAttributes.put(EidasLegalPersonAttributes.SIC, true);
  X509Certificate cert = Utils.readCert(TestEidasSaml.class.getResourceAsStream("/EidasSignerTest_x509.cer"));
  List<X509Certificate> authors = new ArrayList<>();
  authors.add(cert);
  byte[] request = Files.readAllBytes(Paths.get("src/test/resources/EidasSamlRequest_13062017.xml"));
  EidasRequest result = EidasSaml.parseRequest(new ByteArrayInputStream(request), authors);
  assertEquals(issuer, result.getIssuer());
  assertEquals(destination, result.getDestination());
  assertEquals(providerName, result.getProviderName());
  assertEquals(destination, result.getDestination());
  assertEquals(requestedAttributes.size(), result.getRequestedAttributes().size());
  for ( Map.Entry<EidasPersonAttributes, Boolean> entry : result.getRequestedAttributes() )
  {
    assertEquals(requestedAttributes.get(entry.getKey()), entry.getValue());
  }
}