@Test
public void should_parse_notification_use_delta_and_fail_to_use_it() {

    final byte[] certificate = Objects.aParseableCertificate();
    final String sessionId = UUID.randomUUID().toString();
    final byte[] emptySnapshotXml = Objects.snapshotXml(3, sessionId);
    final Objects.SnapshotInfo emptySnapshot = new Objects.SnapshotInfo(SNAPSHOT_URL, Sha256.hash(emptySnapshotXml));
    rrdpClient.add(emptySnapshot.uri, emptySnapshotXml);
    final Objects.DeltaPublish publishCert = new Objects.DeltaPublish("rsync://host/path/cert1.cer", certificate);
    final byte[] deltaXml1 = Objects.deltaXml(2, sessionId, publishCert);
    // republish without hash
    final Objects.DeltaPublish republishCert = new Objects.DeltaPublish("rsync://host/path/cert2.cer", certificate);
    final byte[] deltaXml2 = Objects.deltaXml(3, sessionId, republishCert);
    final Objects.DeltaInfo deltaInfo2 = new Objects.DeltaInfo("https://host/path/delta2.xml", Sha256.hash(deltaXml1), 2);
    final Objects.DeltaInfo deltaInfo3 = new Objects.DeltaInfo("https://host/path/delta3.xml", Sha256.hash(deltaXml2), 3);
    rrdpClient.add(deltaInfo2.uri, deltaXml1);
    rrdpClient.add(deltaInfo3.uri, deltaXml2);
    rrdpClient.add(RRDP_RIPE_NET_NOTIFICATION_XML, Objects.notificationXml(3, sessionId, emptySnapshot, deltaInfo2, deltaInfo3));
    final TrustAnchor trustAnchor = TestObjects.newTrustAnchor();
    wtx0(tx -> this.getTrustAnchors().add(tx, trustAnchor));
    RpkiRepository rpkiRepository = makeRpkiRepository(sessionId, RRDP_RIPE_NET_NOTIFICATION_XML, trustAnchor);
    Ref<RpkiRepository> rpkiRepositoryRef = rtx(tx -> this.getRpkiRepositories().makeRef(tx, rpkiRepository.key()));
    final RrdpRepositoryValidationRun validationRun = wtx(tx ->
            this.getValidationRuns().add(tx, new RrdpRepositoryValidationRun(rpkiRepositoryRef)));
    subject.storeRepository(rpkiRepository, validationRun);
    assertEquals(0, validationRun.getValidationChecks().size());
    final List<RpkiObject> objects = rtx(tx -> this.getRpkiObjects().values(tx));
    assertEquals(1, objects.size());
    rtx0(tx ->
            assertEquals(Sets.newHashSet("rsync://host/path/cert1.cer"), getLocations(tx, objects.get(0))));
    assertEquals(1, objects.size());
}