### Question:
JWTAuthOptionsFactory { public JWTAuthOptions createWithGeneratedKeyPair() { final KeyPair keypair = generateJwtKeyPair(); return new JWTAuthOptions() .setPermissionsClaimKey(PERMISSIONS) .addPubSecKey( new PubSecKeyOptions() .setAlgorithm(ALGORITHM) .setPublicKey(Base64.getEncoder().encodeToString(keypair.getPublic().getEncoded())) .setSecretKey( Base64.getEncoder().encodeToString(keypair.getPrivate().getEncoded()))); }  JWTAuthOptions createForExternalPublicKey(final File externalPublicKeyFile); JWTAuthOptions createWithGeneratedKeyPair();  }### Answer:
@Test public void createsOptionsWithGeneratedKeyPair() { final JWTAuthOptionsFactory jwtAuthOptionsFactory = new JWTAuthOptionsFactory(); final JWTAuthOptions jwtAuthOptions = jwtAuthOptionsFactory.createWithGeneratedKeyPair(); assertThat(jwtAuthOptions.getPubSecKeys()).isNotNull(); assertThat(jwtAuthOptions.getPubSecKeys()).hasSize(1); assertThat(jwtAuthOptions.getPubSecKeys().get(0).getAlgorithm()).isEqualTo("RS256"); assertThat(jwtAuthOptions.getPubSecKeys().get(0).getPublicKey()).isNotEmpty(); assertThat(jwtAuthOptions.getPubSecKeys().get(0).getSecretKey()).isNotEmpty(); }
@Test public void createsOptionsWithGeneratedKeyPairThatIsDifferentEachTime() { final JWTAuthOptionsFactory jwtAuthOptionsFactory = new JWTAuthOptionsFactory(); final JWTAuthOptions jwtAuthOptions1 = jwtAuthOptionsFactory.createWithGeneratedKeyPair(); final JWTAuthOptions jwtAuthOptions2 = jwtAuthOptionsFactory.createWithGeneratedKeyPair(); final PubSecKeyOptions pubSecKeyOptions1 = jwtAuthOptions1.getPubSecKeys().get(0); final PubSecKeyOptions pubSecKeyOptions2 = jwtAuthOptions2.getPubSecKeys().get(0); assertThat(pubSecKeyOptions1.getPublicKey()).isNotEqualTo(pubSecKeyOptions2.getPublicKey()); assertThat(pubSecKeyOptions1.getSecretKey()).isNotEqualTo(pubSecKeyOptions2.getSecretKey()); }