### Question:
JwtHs256BearerTokenSupplier implements BearerTokenSupplier { @Override public String get() { try { return this.ilpOverHttpAuthTokens.get(outgoingLinkSettings.jwtAuthSettings().get().tokenSubject()); } catch (ExecutionException e) { throw new RuntimeException(e); } } JwtHs256BearerTokenSupplier(
      final SharedSecretBytesSupplier sharedSecretBytesSupplier,
      final OutgoingLinkSettings outgoingLinkSettings
  ); @Override String get();  }### Answer:
@Test public void checkCaching() { OutgoingLinkSettings linkSettings = createOutgoingSettings(Duration.ofMinutes(5)); JwtHs256BearerTokenSupplier tokenSupplier = new JwtHs256BearerTokenSupplier(secretBytesSupplier, linkSettings); tokenSupplier.get(); tokenSupplier.get(); verify(secretBytesSupplier).get(); }
@Test public void checkCachingWithCachingDisabled() { OutgoingLinkSettings linkSettings = createOutgoingSettings(Duration.ofMinutes(0)); JwtHs256BearerTokenSupplier tokenSupplier = new JwtHs256BearerTokenSupplier(secretBytesSupplier, linkSettings); tokenSupplier.get(); tokenSupplier.get(); verify(secretBytesSupplier, times(2)).get(); }
@Test public void checkCacheExpiry() throws Exception { OutgoingLinkSettings linkSettings = createOutgoingSettings(Duration.ofMillis(2)); JwtHs256BearerTokenSupplier tokenSupplier = new JwtHs256BearerTokenSupplier(secretBytesSupplier, linkSettings); tokenSupplier.get(); Thread.sleep(3); tokenSupplier.get(); verify(secretBytesSupplier, times(2)).get(); }