@Test void testGetBundleForTrustDomain_notBundleFound_throwsBundleNotFoundException() { X509Bundle x509Bundle = new X509Bundle(TrustDomain.of("example.org")); try { x509Bundle.getBundleForTrustDomain(TrustDomain.of("other.org")); } catch (BundleNotFoundException e) { assertEquals("No X.509 bundle found for trust domain other.org", e.getMessage()); } }
@Override public X509Bundle getBundleForTrustDomain(@NonNull final TrustDomain trustDomain) throws BundleNotFoundException { if (this.trustDomain.equals(trustDomain)) { return this; } throw new BundleNotFoundException(String.format("No X.509 bundle found for trust domain %s", trustDomain)); }
X509Bundle implements BundleSource<X509Bundle> { @Override public X509Bundle getBundleForTrustDomain(@NonNull final TrustDomain trustDomain) throws BundleNotFoundException { if (this.trustDomain.equals(trustDomain)) { return this; } throw new BundleNotFoundException(String.format("No X.509 bundle found for trust domain %s", trustDomain)); } }
X509Bundle implements BundleSource<X509Bundle> { @Override public X509Bundle getBundleForTrustDomain(@NonNull final TrustDomain trustDomain) throws BundleNotFoundException { if (this.trustDomain.equals(trustDomain)) { return this; } throw new BundleNotFoundException(String.format("No X.509 bundle found for trust domain %s", trustDomain)); } X509Bundle(@NonNull final TrustDomain trustDomain);  X509Bundle(@NonNull final TrustDomain trustDomain, @NonNull final Set<X509Certificate> x509Authorities); }
X509Bundle implements BundleSource<X509Bundle> { @Override public X509Bundle getBundleForTrustDomain(@NonNull final TrustDomain trustDomain) throws BundleNotFoundException { if (this.trustDomain.equals(trustDomain)) { return this; } throw new BundleNotFoundException(String.format("No X.509 bundle found for trust domain %s", trustDomain)); } X509Bundle(@NonNull final TrustDomain trustDomain);  X509Bundle(@NonNull final TrustDomain trustDomain, @NonNull final Set<X509Certificate> x509Authorities); static X509Bundle load(@NonNull final TrustDomain trustDomain, @NonNull final Path bundlePath); static X509Bundle parse(@NonNull final TrustDomain trustDomain, @NonNull final byte[] bundleBytes); @Override X509Bundle getBundleForTrustDomain(@NonNull final TrustDomain trustDomain); Set<X509Certificate> getX509Authorities(); boolean hasX509Authority(@NonNull final X509Certificate x509Authority); void addX509Authority(@NonNull final X509Certificate x509Authority); void removeX509Authority(@NonNull final X509Certificate x509Authority); }
X509Bundle implements BundleSource<X509Bundle> { @Override public X509Bundle getBundleForTrustDomain(@NonNull final TrustDomain trustDomain) throws BundleNotFoundException { if (this.trustDomain.equals(trustDomain)) { return this; } throw new BundleNotFoundException(String.format("No X.509 bundle found for trust domain %s", trustDomain)); } X509Bundle(@NonNull final TrustDomain trustDomain);  X509Bundle(@NonNull final TrustDomain trustDomain, @NonNull final Set<X509Certificate> x509Authorities); static X509Bundle load(@NonNull final TrustDomain trustDomain, @NonNull final Path bundlePath); static X509Bundle parse(@NonNull final TrustDomain trustDomain, @NonNull final byte[] bundleBytes); @Override X509Bundle getBundleForTrustDomain(@NonNull final TrustDomain trustDomain); Set<X509Certificate> getX509Authorities(); boolean hasX509Authority(@NonNull final X509Certificate x509Authority); void addX509Authority(@NonNull final X509Certificate x509Authority); void removeX509Authority(@NonNull final X509Certificate x509Authority);  }