@Test void testAddJwtAuthority_emtpyKeyId_throwsIllegalArgumentException() { JwtBundle jwtBundle = new JwtBundle(TrustDomain.of("example.org")); try { jwtBundle.putJwtAuthority("", new DummyPublicKey()); } catch (IllegalArgumentException e) { assertEquals("KeyId cannot be empty", e.getMessage()); } }
public void putJwtAuthority(@NonNull final String keyId, @NonNull final PublicKey jwtAuthority) { if (StringUtils.isBlank(keyId)) { throw new IllegalArgumentException("KeyId cannot be empty"); } jwtAuthorities.put(keyId, jwtAuthority); }
JwtBundle implements BundleSource<JwtBundle> { public void putJwtAuthority(@NonNull final String keyId, @NonNull final PublicKey jwtAuthority) { if (StringUtils.isBlank(keyId)) { throw new IllegalArgumentException("KeyId cannot be empty"); } jwtAuthorities.put(keyId, jwtAuthority); } }
JwtBundle implements BundleSource<JwtBundle> { public void putJwtAuthority(@NonNull final String keyId, @NonNull final PublicKey jwtAuthority) { if (StringUtils.isBlank(keyId)) { throw new IllegalArgumentException("KeyId cannot be empty"); } jwtAuthorities.put(keyId, jwtAuthority); } JwtBundle(@NonNull final TrustDomain trustDomain);  JwtBundle(@NonNull final TrustDomain trustDomain, @NonNull final Map<String, PublicKey> jwtAuthorities); }
JwtBundle implements BundleSource<JwtBundle> { public void putJwtAuthority(@NonNull final String keyId, @NonNull final PublicKey jwtAuthority) { if (StringUtils.isBlank(keyId)) { throw new IllegalArgumentException("KeyId cannot be empty"); } jwtAuthorities.put(keyId, jwtAuthority); } 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> { public void putJwtAuthority(@NonNull final String keyId, @NonNull final PublicKey jwtAuthority) { if (StringUtils.isBlank(keyId)) { throw new IllegalArgumentException("KeyId cannot be empty"); } jwtAuthorities.put(keyId, jwtAuthority); } 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);  }