@Test
public void testFetchTrustAnchorCertificate_rejects_file_url() throws Exception {

    given(trustAnchorRetrievalService.fetchTrustAnchorCertificate(any(), any())).willCallRealMethod();
    final URI uri = new File("/tmp/does-not-exist.cer").toURI();
    trustAnchorRetrievalService.fetchTrustAnchorCertificate(uri, validationResult);
    final List<ValidationCheck> validationChecks = validationResult.getAllValidationChecksForCurrentLocation();
    assertThat(validationChecks).hasSize(1);
    assertThat(validationChecks.get(0).getKey()).isEqualTo(ErrorCodes.TRUST_ANCHOR_FETCH);
}