@Test
public void shouldCleanUpOldValidationRunDontDeleteLastSuccessfulPerTA() {

    TrustAnchor testTA2 = wtx(tx -> factory.createTrustAnchor(tx, ta -> ta.roaPrefixes(roaPrefixes2)));
    wtx0(tx -> getTrustAnchors().add(tx, testTA2));
    Ref<TrustAnchor> testTARef2 = getStorage().readTx(tx -> getTrustAnchors().makeRef(tx, testTA1.key()));
    final InstantWithoutNanos lastMonth = InstantWithoutNanos.now().minus(Duration.ofDays(30));
    CertificateTreeValidationRun oldValidationRun = new CertificateTreeValidationRun(testTARef1);
    oldValidationRun.setCreatedAt(lastMonth);
    oldValidationRun.setCompletedAt(lastMonth);
    wtx0(tx -> getValidationRuns().add(tx, oldValidationRun));
    CertificateTreeValidationRun oldValidationRun2 = new CertificateTreeValidationRun(testTARef2);
    oldValidationRun2.setCreatedAt(lastMonth);
    oldValidationRun2.setCompletedAt(lastMonth);
    oldValidationRun2.setSucceeded();
    wtx0(tx -> getValidationRuns().add(tx, oldValidationRun2));
    AtomicInteger oldCount = subject.cleanupValidationRuns().getLeft();
    assertThat(oldCount.get()).isEqualTo(1);
}