@Test
void validateUnsignedMetadataThrowsSignatureException() throws Exception
{

  EidasMetadataService eidasMetadataService = getEidasMetadataService(false);
  EidasSigner signer = new EidasSigner(keyPair.getKey(), keyPair.getCert());
  byte[] metadataByteArray = eidasMetadataService.generate(signer);
  EntityDescriptor entityDescriptor = getEntityDescriptor(metadataByteArray);
  Signature sig = entityDescriptor.getSignature();
  Credential credential = new BasicX509Credential(keyPair.getCert());
  Assertions.assertThrows(ConstraintViolationException.class,
                          () -> SignatureValidator.validate(sig, credential));
}