@Test
public void should_parse_notification_verify_snapshot_hash() {

    final Objects.Publish cert = new Objects.Publish("rsync://host/path/cert.cer", Objects.aParseableCertificate());
    final Objects.Publish crl = new Objects.Publish("rsync://host/path/crl1.crl", Objects.aParseableCrl());
    rrdpClient.add(cert.uri, cert.content);
    rrdpClient.add(crl.uri, crl.content);
    final int serial = 1;
    final String sessionId = UUID.randomUUID().toString();
    final byte[] snapshotXml = Objects.snapshotXml(serial, sessionId, cert, crl);
    final Objects.SnapshotInfo snapshot = new Objects.SnapshotInfo(SNAPSHOT_URL, Hex.parse("FFFFFF"));
    rrdpClient.add(snapshot.uri, snapshotXml);
    final byte[] notificationXml = Objects.notificationXml(serial, sessionId, snapshot);
    rrdpClient.add(RRDP_RIPE_NET_NOTIFICATION_XML, notificationXml);
    final TrustAnchor trustAnchor = TestObjects.newTrustAnchor();
    wtx0(tx -> this.getTrustAnchors().add(tx, trustAnchor));
    final Ref<TrustAnchor> trustAnchorRef = rtx(tx -> this.getTrustAnchors().makeRef(tx, trustAnchor.key()));
    RpkiRepository rpkiRepository = wtx(tx -> this.getRpkiRepositories().register(tx,
            trustAnchorRef, RRDP_RIPE_NET_NOTIFICATION_XML, RpkiRepository.Type.RRDP));
    rpkiRepository.setRrdpSerial(BigInteger.valueOf(serial));
    Ref<RpkiRepository> rpkiRepositoryRef = rtx(tx ->
            this.getRpkiRepositories().makeRef(tx, rpkiRepository.key()));
    final RrdpRepositoryValidationRun validationRun = new RrdpRepositoryValidationRun(rpkiRepositoryRef);
    subject.storeRepository(rpkiRepository, validationRun);
    final List<RpkiObject> objects = rtx(tx -> this.getRpkiObjects().values(tx));
    assertEquals(0, objects.size());
    assertEquals(1, validationRun.getValidationChecks().size());
    final ValidationCheck validationCheck = validationRun.getValidationChecks().get(0);
    assertEquals(ErrorCodes.RRDP_FETCH, validationCheck.getKey());
    assertEquals(ValidationCheck.Status.ERROR, validationCheck.getStatus());
    assertEquals("Hash of the snapshot file " + SNAPSHOT_URL + " is " + Hex.format(Sha256.hash(snapshotXml)) +
            ", but notification file says FFFFFF", validationCheck.getParameters().get(0));
    assertEquals(rpkiRepository.getRrdpNotifyUri(), validationCheck.getLocation());
}