use of net.ripe.rpki.validator3.domain.TrustAnchorValidationRun in project rpki-validator-3 by RIPE-NCC.
the class TrustAnchorValidationServiceTest method test_success.
@Test
public void test_success() {
TrustAnchor ta = createRipeNccTrustAnchor();
trustAnchors.add(ta);
ta.setLocations(Arrays.asList("src/test/resources/ripe-ncc-ta.cer"));
subject.validate(ta.getId());
ta.setLocations(Arrays.asList(DUMMY_RSYNC_URI));
X509ResourceCertificate certificate = ta.getCertificate();
assertThat(certificate).isNotNull();
Optional<TrustAnchorValidationRun> validationRun = validationRuns.findLatestCompletedForTrustAnchor(ta);
assertThat(validationRun).isPresent();
assertThat(validationRun.get().getStatus()).isEqualTo(ValidationRun.Status.SUCCEEDED);
assertThat(validationRun.get().getValidationChecks()).isEmpty();
}
use of net.ripe.rpki.validator3.domain.TrustAnchorValidationRun in project rpki-validator-3 by RIPE-NCC.
the class TrustAnchorValidationServiceTest method test_empty_file.
@Test
public void test_empty_file() {
TrustAnchor ta = createRipeNccTrustAnchor();
trustAnchors.add(ta);
ta.setLocations(Arrays.asList("src/test/resources/empty-file.cer"));
subject.validate(ta.getId());
ta.setLocations(Arrays.asList(DUMMY_RSYNC_URI));
assertThat(ta.getCertificate()).isNull();
Optional<TrustAnchorValidationRun> validationRun = validationRuns.findLatestCompletedForTrustAnchor(ta);
assertThat(validationRun).isPresent();
List<ValidationCheck> validationChecks = validationRun.get().getValidationChecks();
assertThat(validationChecks).hasSize(1);
assertThat(validationChecks.get(0).getKey()).isEqualTo(ErrorCodes.REPOSITORY_OBJECT_MINIMUM_SIZE);
}
use of net.ripe.rpki.validator3.domain.TrustAnchorValidationRun in project rpki-validator-3 by RIPE-NCC.
the class TrustAnchorValidationServiceTest method test_rsync_failure.
@Test
public void test_rsync_failure() {
TrustAnchor ta = createRipeNccTrustAnchor();
ta.setLocations(Arrays.asList(DUMMY_RSYNC_URI));
trustAnchors.add(ta);
subject.validate(ta.getId());
assertThat(ta.getCertificate()).isNull();
Optional<TrustAnchorValidationRun> validationRun = validationRuns.findLatestCompletedForTrustAnchor(ta);
assertThat(validationRun).isPresent();
List<ValidationCheck> validationChecks = validationRun.get().getValidationChecks();
assertThat(validationChecks).hasSize(1);
assertThat(validationChecks.get(0).getKey()).isEqualTo(ErrorCodes.RSYNC_FETCH);
}
use of net.ripe.rpki.validator3.domain.TrustAnchorValidationRun in project rpki-validator-3 by RIPE-NCC.
the class TrustAnchorValidationServiceTest method test_bad_subject_public_key.
@Test
public void test_bad_subject_public_key() {
TrustAnchor ta = createRipeNccTrustAnchor();
ta.setSubjectPublicKeyInfo(ta.getSubjectPublicKeyInfo().toUpperCase());
trustAnchors.add(ta);
ta.setLocations(Arrays.asList("src/test/resources/ripe-ncc-ta.cer"));
subject.validate(ta.getId());
ta.setLocations(Arrays.asList(DUMMY_RSYNC_URI));
assertThat(ta.getCertificate()).isNull();
Optional<TrustAnchorValidationRun> validationRun = validationRuns.findLatestCompletedForTrustAnchor(ta);
assertThat(validationRun).isPresent();
List<ValidationCheck> validationChecks = validationRun.get().getValidationChecks();
assertThat(validationChecks).hasSize(1);
assertThat(validationChecks.get(0).getKey()).isEqualTo("trust.anchor.subject.key.matches.locator");
}
Aggregations