@Test void testgetBundleForTrustDomain_doesNotExiste_ThrowsBundleNotFoundException() { JwtBundle jwtBundle = new JwtBundle(TrustDomain.of("example.org")); try { jwtBundle.getBundleForTrustDomain(TrustDomain.of("other.org")); fail("exception expected"); } catch (BundleNotFoundException e) { assertEquals("No JWT bundle found for trust domain other.org", e.getMessage()); } }
@Override public JwtBundle getBundleForTrustDomain(final TrustDomain trustDomain) throws BundleNotFoundException { if (this.trustDomain.equals(trustDomain)) { return this; } throw new BundleNotFoundException(String.format("No JWT bundle found for trust domain %s", trustDomain)); }
JwtBundle implements BundleSource<JwtBundle> { @Override public JwtBundle getBundleForTrustDomain(final TrustDomain trustDomain) throws BundleNotFoundException { if (this.trustDomain.equals(trustDomain)) { return this; } throw new BundleNotFoundException(String.format("No JWT bundle found for trust domain %s", trustDomain)); } }
JwtBundle implements BundleSource<JwtBundle> { @Override public JwtBundle getBundleForTrustDomain(final TrustDomain trustDomain) throws BundleNotFoundException { if (this.trustDomain.equals(trustDomain)) { return this; } throw new BundleNotFoundException(String.format("No JWT bundle found for trust domain %s", trustDomain)); } JwtBundle(@NonNull final TrustDomain trustDomain);  JwtBundle(@NonNull final TrustDomain trustDomain, @NonNull final Map<String, PublicKey> jwtAuthorities); }
JwtBundle implements BundleSource<JwtBundle> { @Override public JwtBundle getBundleForTrustDomain(final TrustDomain trustDomain) throws BundleNotFoundException { if (this.trustDomain.equals(trustDomain)) { return this; } throw new BundleNotFoundException(String.format("No JWT bundle found for trust domain %s", trustDomain)); } JwtBundle(@NonNull final TrustDomain trustDomain);  JwtBundle(@NonNull final TrustDomain trustDomain, @NonNull final Map<String, PublicKey> jwtAuthorities); static JwtBundle load(@NonNull final TrustDomain trustDomain, @NonNull final Path bundlePath); static JwtBundle parse(
            @NonNull final TrustDomain trustDomain,
            @NonNull final byte[] bundleBytes); @Override JwtBundle getBundleForTrustDomain(final TrustDomain trustDomain); Map<String, PublicKey> getJwtAuthorities(); PublicKey findJwtAuthority(final String keyId); boolean hasJwtAuthority(final String keyId); void putJwtAuthority(@NonNull final String keyId, @NonNull final PublicKey jwtAuthority); void removeJwtAuthority(final String keyId); }
JwtBundle implements BundleSource<JwtBundle> { @Override public JwtBundle getBundleForTrustDomain(final TrustDomain trustDomain) throws BundleNotFoundException { if (this.trustDomain.equals(trustDomain)) { return this; } throw new BundleNotFoundException(String.format("No JWT bundle found for trust domain %s", trustDomain)); } JwtBundle(@NonNull final TrustDomain trustDomain);  JwtBundle(@NonNull final TrustDomain trustDomain, @NonNull final Map<String, PublicKey> jwtAuthorities); static JwtBundle load(@NonNull final TrustDomain trustDomain, @NonNull final Path bundlePath); static JwtBundle parse(
            @NonNull final TrustDomain trustDomain,
            @NonNull final byte[] bundleBytes); @Override JwtBundle getBundleForTrustDomain(final TrustDomain trustDomain); Map<String, PublicKey> getJwtAuthorities(); PublicKey findJwtAuthority(final String keyId); boolean hasJwtAuthority(final String keyId); void putJwtAuthority(@NonNull final String keyId, @NonNull final PublicKey jwtAuthority); void removeJwtAuthority(final String keyId);  }