@Test
public void should_parse_notification_and_snapshot() {

    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, Sha256.hash(snapshotXml));
    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));
    final RrdpRepositoryValidationRun validationRun = wtx(tx -> {
        Ref<RpkiRepository> ref = this.getRpkiRepositories().makeRef(tx, rpkiRepository.key());
        return this.getValidationRuns().add(tx, new RrdpRepositoryValidationRun(ref));
    });
    subject.storeRepository(rpkiRepository, validationRun);
    final List<RpkiObject> objects = rtx(tx -> this.getRpkiObjects().values(tx));
    assertEquals(2, objects.size());
    rtx0(tx -> {
        assertTrue(objects.stream().anyMatch(o -> cert.uri.equals(getLocations(tx, o).first())));
        assertTrue(objects.stream().anyMatch(o -> crl.uri.equals(getLocations(tx, o).first())));
    });
}