OnlineCRLSource implements CRLSource, RevocationSourceAlternateUrlsSupport<CRL>, OnlineRevocationSource<CRL> { @Override public CRLToken getRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken) { return getRevocationToken(certificateToken, issuerCertificateToken, Collections.<String>emptyList()); } OnlineCRLSource();  OnlineCRLSource(final DataLoader dataLoader); void setPreferredProtocol(final Protocol preferredProtocol); @Override void setDataLoader(final DataLoader dataLoader); @Override CRLToken getRevocationToken(CertificateToken certificateToken, CertificateToken issuerCertificateToken); @Override CRLToken getRevocationToken(final CertificateToken certificateToken, final CertificateToken issuerToken,
			List<String> alternativeUrls);  }
@Test public void getRevocationTokenTest() { CRLToken revocationToken = onlineCRLSource.getRevocationToken(goodUser, goodCa); assertNull(revocationToken); revocationToken = onlineCRLSource.getRevocationToken(goodCa, rootCa); assertNotNull(revocationToken); }
@Test public void getRevocationTokenEd25519Test() { CRLToken revocationToken = onlineCRLSource.getRevocationToken(ed25519goodCa, ed25519goodUser); assertNull(revocationToken); revocationToken = onlineCRLSource.getRevocationToken(ed25519goodCa, ed25519RootCa); assertNotNull(revocationToken); assertTrue(revocationToken.isValid()); assertEquals(SignatureAlgorithm.ED25519, revocationToken.getSignatureAlgorithm()); assertEquals(SignatureValidity.VALID, revocationToken.getSignatureValidity()); }
@Test public void getRevocationTokenWithAlternateUrlTest() { CRLToken wrongRevocationToken = onlineCRLSource.getRevocationToken(goodUser, goodCa, Arrays.asList(alternative_url)); assertNull(wrongRevocationToken); CRLToken revocationToken = onlineCRLSource.getRevocationToken(goodCa, rootCa, Arrays.asList(alternative_url)); assertNotNull(revocationToken); }
@Test public void getRevocationTokenWithWrongAlternateUrlTest() { CRLToken revocationToken = onlineCRLSource.getRevocationToken(goodUser, goodCa, Arrays.asList(wrong_url)); assertNull(revocationToken); revocationToken = onlineCRLSource.getRevocationToken(goodCa, rootCa, Arrays.asList(wrong_url)); assertNotNull(revocationToken); }
@Test public void timeoutTest() { dataLoader.setTimeoutConnection(1); CRLToken revocationToken = onlineCRLSource.getRevocationToken(goodUser, goodCa, Arrays.asList(wrong_url, alternative_url)); assertNull(revocationToken); revocationToken = onlineCRLSource.getRevocationToken(goodCa, rootCa, Arrays.asList(wrong_url, alternative_url)); assertNull(revocationToken); dataLoader.setTimeoutConnection(6000); }